Guys I am trying to realise given input should loop through my float list named enerji and print out the first element if it is less than it and 1 before element of it. (edit y=82 in my case it is deffined above but not seen)
here is the code:
a = 0
input_bigger_than_energy = False
while a!= y and not(input_bigger_than_energy):
energy = float(input('write down interwal of energy between 1000 and
100000000000:'))
if energy > enerji[a]:
a=a+1
else:
input_bigger_than_energy = True
print(a)
print(enerji[a])
print(enerji[a-1])
enerji = [1000.0, 1500.0, 1838.8, 1838.9, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 8000.0, 10000.0, 15000.0, 20000.0, 30000.0, 40000.0, 50000.0, 60000.0, 80000.0, 100000.0, 150000.0, 200000.0, 300000.0, 400000.0, 500000.0, 600000.0, 800000.0, 1000000.0, 1022000.0, 1250000.0, 1500000.0, 2000000.0, 2044000.0, 3000000.0, 4000000.0, 5000000.0, 6000000.0, 7000000.0, 8000000.0, 9000000.0, 10000000.0, 11000000.0, 12000000.0, 13000000.0, 14000000.0, 15000000.0, 16000000.0, 18000000.0, 20000000.0, 22000000.0, 24000000.0, 26000000.0, 28000000.0, 30000000.0, 40000000.0, 50000000.0, 60000000.0, 80000000.0, 100000000.0, 150000000.0, 200000000.0, 300000000.0, 400000000.0, 500000000.0, 600000000.0, 800000000.0, 1000000000.0, 1500000000.0, 2000000000.0, 3000000000.0, 4000000000.0, 5000000000.0, 6000000000.0, 8000000000.0, 10000000000.0, 15000000000.0, 20000000000.0, 30000000000.0, 40000000000.0, 50000000000.0, 60000000000.0, 80000000000.0, 100000000000.0]
problem code works but it is asking me again to input
break. Also, I don't see whereiis defined at all. In essence, your condition on the while loop isn't evaluating like you think it is.