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
3/12/2020 7:44:33 AM
Alvreius Dante13 Answers
New AnswerIn 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.
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
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.
I hope it really helped you and yes PIP stopped supporting python 2
Get back in the next 2 years to master python 3 for soon will be released python 4
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......
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message