0
What's wrong with this code?
num1 = input("Tell me a number: ") num2 = input("Tell me another number: ") if num1>num2: print "%d is greater than %d!" % num1,num2 elif num2>num1: print "%d is greater than %d!" % num2,num1
2 odpowiedzi
+ 6
Looks like old Python (2.x) syntax?
print() requires parentheses in version 3.x
% syntax works but there's also:
print( "{} is greater than {}".format(num1, num2) )
+ 1
Thanks a lot!