+ 3
Did I do something wrong?
print ("Whats your name?") user_name = input() if user_name == "Albert": print ("<Dang> You") elif user_name == "Mark": print ("Whats up,Mark?") else: print ("Hello," + user_name + "!Have a nice day") I made this code in python it worked I made some modifications and now when I put the input "Albert" it doesn't do what is supposed to
14 ответов
+ 1
I thinks what's wrong in your code is the indentation, there are 2 tabs there
If user_name == "Albert":
print("...")
Good day man !
+ 3
print("Whats your name?")
user_name = input()
if user_name == "Albert":
print("I love you!")
elif user_name == "Mark":
print("Whats up, Mark?")
else:
print("Hello, " + user_name + "! Have a nice day")
#does this code do what you want?
+ 3
Potato Squad my auto correct <kindly and mistakenly messes> me over every time
+ 2
I changed the indentation in the code, it's really important in python, test it 🙃
+ 2
do you input "Albert" or "Albert "? (yes there is a big diffrence)
+ 2
Anton Böhler looks like my phone was auto completing my input and putting a space after it
+ 2
https://code.sololearn.com/c7pnSpRFZEEZ/?ref=app
Work for me
Please check if you use first capital letter.
+ 2
Lol Faisal
+ 2
Hi, first sorry by my poor English... It isn't my first language... It is spanish...
I have not problem with your program....
I think that you put "albert" and if you pay attention in your sentences "if" you put Albert.... So the problem is that albert != Albert because one have uppercase and other lowercase. Both are not equals
+ 1
Anton Böhler lmao
+ 1
Anton Böhler still gives me the answer "Hello,Albert ! Have a nice day"
+ 1
"Albert" Anton Böhler
+ 1
well that doesn't make sense ... for me it works when i input "Albert" 🤷♂️
+ 1
Potato Squad I said in a comment what I did wrong