Apr-16-2021, 11:34 AM
(This post was last modified: Apr-16-2021, 01:19 PM by Yoriz.
Edit Reason: Added code tags
)
questions = ["What is your name?", "What is your favorite color?", "What is your quest?"] n = 0 while True: print("Type q to quit") answer = input(questions[n]) if answer == "q": break n += 1 if n > 2: n = 0abouv is a some code I don't get. If I remove all the questions but one, this code give the following error:
Error:line 5, in <module>
answer = input(questions[n])
IndexError: list index out of range
I cannot find what is the matter