0
Can anyone please tell me what's wrong with my code?
value = input("enter your name:") int(value) if value <= 5: print ("greater than 5") if value >= 5: print ("less than 5")
9 Answers
+ 3
Iyed Bouazdia the code
How can the input be in " " if you want to code with integers (int)
Your mistake was
value=input("Enter Your Name")
But rather I will encourage you to use
value=input()
And also use the elif statement for the second one
Thank you
+ 2
Code Crasher that was I said in the answer
+ 2
Code Crasher Yes that was what I was thinking about was it the length of the name?
+ 1
Hay Iyed Bouazdia your code is also correct . But you had done one mistake you are talking input as string . And after that you are trying to convert it into int . Yes ofcourse you had converted it using int(value) but if no variable is assigned to it then how will it be used . So do a simple thing overwrite the value .
Like this \/
value = input("enter your name:")
value = int(value)
if value <= 5:
print ("greater than 5")
if value >= 5:
print ("less than 5")
and second thing always take care of indentation in python. in your code second error is of indentation. ok
+ 1
thanks guys, I really appreciate it. I got it now
+ 1
code crasher thanks. That actually makes a lot of sense



