[Solved]Problem in while LOOP | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

[Solved]Problem in while LOOP

I was working on a challenge ,then this came in output(TypeError: '<=' is not supported instance of 'str' and 'int') https://code.sololearn.com/c50E84iHwmY3/?ref=app

26th May 2020, 4:35 AM
Aronya Biswas
Aronya Biswas - avatar
1 Answer
+ 3
Comparison operators such as <, >=, ==, != and the rest work for only floats and integers. You can't compare strings and in your code I see that the input was not converted to a number. Convert the input to an int using int() or to a float using float() and I think it will solve that problem
26th May 2020, 5:34 AM
Derrick Zziwa
Derrick Zziwa - avatar