+ 4
i don't know why my short python scribe show me error massage when i enter 7 as name input.
nam=input() if name==7: print(" ")
5 Réponses
+ 4
clovert
nam=input()
if name==7: #1: nam==7
print(" ")
#2: You are trying to compare the string variable "nam" with a number, so nam != 7.
You need to convert the string variable "nam" to a number variable, or the number 7 to the character "7".
+ 8
clovert You should pay attention to your variable names when you code. Even a slightly different character implies an entirely new variable.
+ 7
Line 1: The variable is nam
Line 2: Some random variable never declared before called name has been used in an expression.
To fix, change line 1 "nam" to "name" or "name" to "nam"
+ 5
clovert you wrote
nam=input()
Then your saying
if name==7:
Your error is in line 1
0
Its nam var which have input by user
Not name
see variable declaration