0

This is a code i am working on but when i execute it , creates a problem towards the end

restart = "No" or "no"
while restart == "No" or "no":

    print("League Registration")
    Fristname = input("What is first name?")
    Lastname = input("What is your Last name?")
    Nickname = input("What is your nick name?")
    Eaddress = input("What is your e-mail address?")
    Skill = input("What is your skill level, E for expert or C for casual?")
    if Skill  == "C" or Skill == "c":
        print("Casual")
    elif Skill == "E" or Skill == "e":
        print("Expert")


    print (" These are your personal details:")

    print ("First Name:",Fristname)

    print("Last Name:",Lastname)

    print("Nickname:",Nickname)

    print("Email Address:",Eaddress)

    print("Skill Level:",Skill)

    Detailscon = input("Are your personal details correct: Yes or No?")

    if restart == "Yes" or "yes":
        print("Thanl you , you are now registered")
    elif restart == "No" or "no":
        print("Try again")

my code towards the end keeps messing up i don't know what to do

Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555
Esh
  • 11

1 Answers1

2

The error in your code, lies here. You see, in python

    while (restart == "No") or "no":

The operator equal will evaluate first and then check if it is true or if the string "no" is longer than zero, which it is so it will run forever.

Instead change it to.

    while restart in ["No", "no"]: 
Coder3000
  • 130
  • 7
  • i did but when i execute the code it loops it to the beginning when i type yes which i don't want it to do – Esh Jan 15 '17 at 18:39
  • @Esh because you assing `"Yes"` to `Detailscon` and you don't change `reset` which still is `"No"` – furas Jan 15 '17 at 18:58
  • but how do i so that ,please edit my code to help me – Esh Jan 15 '17 at 19:17
  • @Esh it is so simple that there is nothing to edit: you need `restart = input(..)` instead of `Detailscon = input(...)` – furas Jan 15 '17 at 20:00