+ 1
Python3
Why python 3 is case sensitive when asking input example x = input("Name=") if x == "dante": print("Hello master") else: print("Hello user") when i input Dante the program execute else help please
13 Réponses
+ 4
In every language, uppercase letters and lowercase letters are different. So "Dante" can never be equal to "dante".
To make your code work you can replace
'if x == "dante":'
With
'if x.lower() == "dante":'
What .lower() does is convert the string to lowercase.
+ 3
Sure.... Dante is not dante.
+ 2
D & d have different character ordinals which means that Dante will be interpreted as being != to dante. (as Oma Falk stated)
I have attached something which I hope will help you understand further.
https://code.sololearn.com/c7S4Mxsbwa9l/?ref=app
+ 2
As far as I know, There is different value attached with each alphabet. So B has different value, b has different value. So any programming language is case sensitive as it directly speaks with the machine.
+ 2
Правильно
x = Type(input())
+ 2
Such is the syntax
+ 2
Python basically case sensitive so you sent correct input or change your program ....
x = input("Name=")
if x == "dante" or x == "Dante":
print(" Hello master")
else:
print("Hello user")
Your input is work this code correct output......
+ 1
I hope it really helped you and yes PIP stopped supporting python 2
+ 1
Get back in the next 2 years to master python 3 for soon will be released python 4
0
.........
0
Thanks
0
thank you for the very late answer i really appreciate it
0
not sure but there's already python 3.1 in testing so im not quite sure about 4.0+