xxxxxxxxxx
# Initialize an empty list to store dictionaries
user_list = []
# Ask the user for input
while True:
name = input("Enter your name (or 'quit' to exit): ")
if name.lower() == 'quit':
break
age = input("Enter your age: ")
# Create a dictionary for the user and add it to the list
user_info = {
"name": name,
"age": age
}
user_list.append(user_info)
# Print the list of dictionaries
print("List of user information:")
for user_info in user_list:
print(user_info)
xxxxxxxxxx
for key,values in queue_dict.items():
for v in values:
print(key," : ",v)