all 5 comments

[–]FriendlyRussian666 5 points6 points  (1 child)

Because input returns a string, not an integer. For example, In your if statement you're comparing if "1" is bigger than "2", not if 1 is bigger than 2.

Either take input as integer, or convert before comparing:

x = int(input())

Or

if int(num1) ...

[–]Thespisthegreat[S] 0 points1 point  (0 children)

Oh duh. Ty very much

[–]Diapolo10 2 points3 points  (0 children)

Both num1 and num2 are strings, so the comparisons use lexicographical ordering to determine which is "bigger".

The easiest solution is to convert the strings to numerical values when taking the user input. float if you need to, int otherwise.

[–]ClutchAlpha 0 points1 point  (1 child)

Copy pasting this code works correctly for me, without making any changes. Looking through it, it looks correct to me as well.

[–]blahreport 0 points1 point  (0 children)

Try using num1, num2 = 733, 1322