fork download
  1. # your code goes here
  2. lista =[-9 ,20.5, 6 ,10.8, 10, 8.0, 45, -99.6, 12, -54.7]
  3. num1 = 9
  4. num2 = 20.7
  5. for i in range(len(lista)):
  6. if lista[i] < num1:
  7. lista[i]= -1
  8. if lista[i] > num2:
  9. lista[i] = 9999.0
  10.  
  11. print(lista)
Success #stdin #stdout 0.04s 9404KB
stdin
Standard input is empty
stdout
[-1, 20.5, -1, 10.8, 10, -1, 9999.0, -1, 12, -1]