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

9th Jul 2017, 3:06 PM
Captain George
Captain George - avatar
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) )
9th Jul 2017, 3:15 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
Thanks a lot!
9th Jul 2017, 4:58 PM
Captain George
Captain George - avatar