First question, so please be nice...also the first program I've ever built from the ground up.
Really basic quiz program. There are three possible answers. If the input is out of range, the program returns an error message.
But, I'd like to give the user another shot at it if the user puts something in that's completely out of range. Right now the program just keeps progressing and won't repeat the last question.
Additionally, testing for a letter instead of an integer is not working.
Thanks for any help passed onto this first timer.
for i in range(1, len(questions)):
print""
print""
print "Number " + str(i) + ": " + questions[i]
print ""
answers = raw_input("Select 1 for Demolition Man\n2 for Judge Dredd\nor 3 for BOTH!\nAnswer ")
if answers == answer_key[i]:
score += 1
print "Correct!"
else:
if answers < 1:
print "Sorry, that's not one of the possible answers"
i -= 1
elif answers > 3:
print "Sorry, that's not one of the possible answers"
i -= 1
elif type(answers) != int:
print "Sorry that's not one of the possible answers"
i -= 1
else:
print "You just don't know that one..."