Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if elif problem :)
#1
Hi i am starting coding and i got this problem
#* This is the code
right_name = input("is your right name " + right_name " yes / no ? ")
if right_name == "y" or "YES" or "yes":
    print("We go to the next")
elif right_name == "no" or "No" or "NO" or "no" or "n":
    print("We will return now ")
else:
    print("Error !")
#* What is the problem i always get a right name and go to the if ?
Reply
#2
Please, read Multiple expressions with or keyword
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Okey ty for the help fixed :D
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Whats the right way to refactor this Big if/elif/elif ? pitosalas 1 2,237 Jul-28-2019, 05:52 PM
Last Post: ichabod801
  Problem with elif statement Haddal99 2 2,269 May-20-2019, 09:26 AM
Last Post: avorane
  Problem witrh else and elif values. anolibal 7 6,487 Aug-20-2018, 11:50 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020