How do you make comparisons between a user input variable and an integer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do you make comparisons between a user input variable and an integer

How plz help https://code.sololearn.com/cOZO4tYhFQKK/?ref=app

22nd Apr 2019, 4:16 PM
Justin Vanstrom
Justin Vanstrom - avatar
2 Answers
+ 4
Input return a string and you cant compare integer with string. You just need to apply this fix. num = int(input("rate your day on a scale of one to ten in numbers :")) So you will transform the string in an integer and you will be able to compare.
22nd Apr 2019, 4:30 PM
Anya
Anya - avatar
+ 1
your a lifesaver thanks mate
22nd Apr 2019, 4:31 PM
Justin Vanstrom
Justin Vanstrom - avatar