Aug-30-2017, 05:12 PM
(Aug-30-2017, 04:24 PM)ichabod801 Wrote: First, you want to use == (double equals) for comparison, not is. Second, input returns a string, not a number. So it returns '5', which is not the same as 5. So you either want to convert the input to an integer (number = int(number)
), or you want to test against a string (if number == '5':
).
I feel incredibly stupid! However, I used this line of code:
number = float(input("type number here")) #instead of number = int(number) #I also tried this number = int(input("type number here")) ''' and it also worked. However, whats the difference between float and int? when do you use float or int? or it doesn't matter? '''