Question in Python with if / elif statements | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Question in Python with if / elif statements

Now the question ... when entering any thing to the "name" it just runs the first if statement or any "or" statement available .Still a beginner . That's the code : print("Welcome to our first miniprogramm !!!") name = input("Enter your name please : ") if name == "Ecco" or "ecco" or "Neon" or "neon" : print ("Hello Ranger 1 !!") elif name == "Ranger" or "ranger" : print("Hello Ranger 2 !!") elif name == "Zeon" or "zeon" : print("Hello Ranger 3 !!") else: print("You are not auser Sir.") print("") print("Programm ended.")

21st Jan 2020, 5:58 AM
Ecco
Ecco - avatar
1 Answer
+ 4
21st Jan 2020, 6:10 AM
Aymane Boukrouh
Aymane Boukrouh - avatar