+ 1
This program runs fine in python 3 but not in python 2 . Why???
3 odpowiedzi
+ 4
Built-in input function behaviour is different between py2 and py3. In py2, it read input, try to evalute the expression with eval function and return it, then if your input is an number, it would return an int number. In py3 instead, it return simply the input like string.
Because this, and because you compare his return value with strings, your "if" conditions never will be true (a int is not a string) in py2 but work correctly in py3
+ 1
thanks KrOW
0
👍👍👍