+ 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

12th Mar 2020, 7:44 AM
CutieRei
CutieRei - avatar
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.
12th Mar 2020, 7:51 AM
XXX
XXX - avatar
+ 3
Sure.... Dante is not dante.
12th Mar 2020, 7:48 AM
Oma Falk
Oma Falk - avatar
+ 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
12th Mar 2020, 8:03 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 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.
27th Mar 2020, 9:25 PM
Sunit Chattoraj
Sunit Chattoraj - avatar
+ 2
Правильно x = Type(input())
25th Jan 2021, 5:47 AM
‎ Герман Папанов(הרמן פפנוב)‎
‎ Герман Папанов(הרמן פפנוב)‎ - avatar
+ 2
Such is the syntax
25th Jan 2021, 5:47 AM
‎ Герман Папанов(הרמן פפנוב)‎
‎ Герман Папанов(הרמן פפנוב)‎ - avatar
+ 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......
8th Feb 2021, 6:04 PM
Saravanan .s
Saravanan .s - avatar
+ 1
I hope it really helped you and yes PIP stopped supporting python 2
25th Jan 2021, 6:32 PM
‎ Герман Папанов(הרמן פפנוב)‎
‎ Герман Папанов(הרמן פפנוב)‎ - avatar
+ 1
Get back in the next 2 years to master python 3 for soon will be released python 4
25th Jan 2021, 6:32 PM
‎ Герман Папанов(הרמן פפנוב)‎
‎ Герман Папанов(הרמן פפנוב)‎ - avatar
0
.........
12th Mar 2020, 7:51 AM
CutieRei
CutieRei - avatar
0
Thanks
12th Mar 2020, 7:55 AM
CutieRei
CutieRei - avatar
0
thank you for the very late answer i really appreciate it
25th Jan 2021, 7:10 AM
CutieRei
CutieRei - avatar
0
not sure but there's already python 3.1 in testing so im not quite sure about 4.0+
25th Jan 2021, 11:40 PM
CutieRei
CutieRei - avatar