I have a program that asks a user to come up with a question and then to type the answer. Right now I have it asking the user to type in 5 questions and answers. So basically it asks the user for a question and its answer 5 times. What I would really like it to do is ask the user for how many questions they would like to type and then based on that it presents the user with "type your question" and "type your answer" and stores those things as variables (i.e. "q1" and "a1" and repeating based on how many questions/answers they want to type) so I can then use these variables in a print statement later on in the program. I was thinking about using a while loop with a continue condition until and count down to 0 and then the loop ends but how do I constantly create new variables?
` oneistart= raw_input('What is the first question: ')
oneiend= raw_input('What is the first answer: ')
keyand answer is the relevant 'value'. You should research on them.dictis good for this. See How do I do variable variables in Python? and How can I create lists from a list of strings?dictlets you find the answer if you're given the question. Another data structure worth considering for this is a list of tuples, with the question as one member of the tuple and the answer as the other.