New Python learner here. I've looked all over for assistance but I can't seem to find a solution to my problem. I want to create a dictionary from user input, but for some of the variables, I would like to include if/then or while statements in order to skip questions that are irrelevant based on the user input. Here is an example of my code so far:
input_dict = {'var1': input('Question 1:\n'),
'var2': input('Question 2:\n'),
'var3': input('Question 3:\n'),
'var4': input('Question 4:\n')}
What I'd like to do is create a loop where if the answer to Question 3 is 'no', then it would skip question 4.
I also realize that I may be approaching this problem incorrectly. The end goal is to create a dataframe of information from the user input.