0
course=int(raw_input("What level is your course, 5/6? "))

Finishing off an assignment, how would I have it set so that if 5 or 6 are not entered it will ask the question again as they are the only two possible answers, Struggling to create an if loop that can have more then one condition, any help would be appreciated, thanks!

Mohammad Yusuf
  • 16,554
  • 10
  • 50
  • 78
Grimble6
  • 25
  • 6
  • I don't understand the question... – SaggingRufus Jan 10 '17 at 17:53
  • There are two basic loops: `for` and `while`. You should use a `for` loop when you want to do something a certain number of times and you should use a `while` loop when you want to do something until some condition changes. In this case you want a `while` loop – Patrick Haugh Jan 10 '17 at 17:55

1 Answers1

0

Try using a while loop instead:

course = 0
while course != 5 and course != 6:
    course = int(raw_input("What level is your course, 5/6? "))

print course
Alden
  • 2,229
  • 1
  • 15
  • 21