[
After about an hour of being dumb i finally got the loop to work but now i have a different problem. The program asks for some input like the low end number the high end number and the step number. So when you put in 1,10,1 it'll print out 10 numbers and it works fine. Unfortunately if you put in 1,100,10 (Like in the second example in my lab booklet) it prints out 11 numbers. The numbers are 1,11,21,31,41,51,61,71,81,91 and for some odd reason 92.
Here's the code.
After about an hour of being dumb i finally got the loop to work but now i have a different problem. The program asks for some input like the low end number the high end number and the step number. So when you put in 1,10,1 it'll print out 10 numbers and it works fine. Unfortunately if you put in 1,100,10 (Like in the second example in my lab booklet) it prints out 11 numbers. The numbers are 1,11,21,31,41,51,61,71,81,91 and for some odd reason 92.
Here's the code.
a='Pounds' b='Ounces' c='Kilograms' low=int(input('Enter a low value:')) high=int(input('Enter a high value:')) step=int(input('Enter a step value:')) print('{0:<10}{1:^10}{2:>10}'.format(a,b,c)) for weight in range(low,high,step): print('{0:<10.1f}{1:^10.1f}{2:>10.1f}'.format(weight,weight*16,weight*453.592)) else: print('{0:<10.1f}{1:^10.1f}{2:>10.1f}'.format(weight+1,(weight+1)*16,(weight+1)*453.592))Any hint at what is causing this issue would be great.