+ 1
What is wrong with this code?
a = input ("insert number: ") if (a) > 5: print("(a) greater than 5")
6 Answers
+ 11
a = input("insert number: ")
a = int(a)
if a > 5:
print("{0} greater than 5".format(a))
+ 7
Can you tell me what error it says or what should be the correct output?
+ 5
@Vasu Gandhi We're happy to help buddy =D
+ 2
if I input 25, I want output to be "25 is greater than 5"
+ 1
thanks for your help complex and steini!
+ 1
see by default any input is a string that's why add int before your input command like this:
>>> a=int(input("ENTER"))
>>> if a>5:
print("END")
And adding the brackets around the a makes no sense but since it is not affecting the program in any way I guess it doesn't matter