r/AskProgramming • • Oct 11 '26

For loop

How would I store 3 different answers to the same 3 questions asked using a for loop. I know how to store one answer, but not all three while still using the for loop

0 Upvotes

13 comments sorted by

View all comments

1

u/Forward_Problem_8982 Oct 11 '26

You have a container like a list outside the loop. Every time you get an answer inside the loop, you put it to the end of the list. After the loop, all your answers are in the list in the order that you put them in.