I am pretty new to Python and I am having trouble with this 'quiz' I am creating.
answer_1_choices = {
'A' : 'A: A list is a datatype that stores a sequence of items with individual indexes that are mutable.',
'B' : 'B: A list is a datatype that stores a sequence of items with individual indexes that are immutable.',
'C' : 'C: A list is a datatype that stores a sequence of items assigned to individual keys that are immutable.'
}
Number_One = '1. What is a list?'
def answer():
x = input()
if x == 'A' or x == 'a':
print('Correct!')
else:
print('That is an incorrect response. Please try again.' + '\n' + '\n' + Number_One + '\n')
print(answer_1_choices['A'] + '\n' + '\n' + answer_1_choices['B'] + '\n' + '\n' + answer_1_choices['C'])
print('\n' + 'Is the answer A, B, or C? Type the letter of your choice.')
def question_one():
print(Number_One + '\n')
print(answer_1_choices['A'] + '\n' + '\n' + answer_1_choices['B'] + '\n' + '\n' + answer_1_choices['C'])
print('\n' + 'Is the answer A, B, or C? Type the letter of your choice.')
question_one()
answer()
I want the else statement to run infinitely every time that the input is something other than 'A' or 'a'. I know I have to use some kind of loop or something, but I just can't seem to figure it out. Can someone help me?