Can Python automatically create a new array and append new information to it, within a loop? This is just a question for learning purposes.
For example, I am trying to write a program that appends information to an array called record001. Then after some steps, want to append new information to a new array, but create that variable name automatically within a loop? Is this possible? I've given an example below:
counter = 0
record001 = []
while (counter > -1):
user_id = input("Enter your 5-digit ID: ")
record001.append(user_id)
yob = int(input("Enter your 4-digit year of birth: "))
record001.append(yob)
counter += 1
print("Information Appended to Record #: " + str(counter))
print(record001)
else:
print("Program terminated")
Thank you