I have a problem printing a list. For example, I have two lists:
a = [1,2,3,4,5]
b = [6,7,8,9,10]
Now I want to ask the user to enter a list name and then print this list.
name = input("Write a list name")
User entered "a"
for x in name:
print(x)
But this does not work (without printing list "a"). Could you please help me?
ADDITIONAL INFORMATION:
I have a dictionary:
poland = {"poznan": 86470,
"warszawa": 86484,
"sopot": 95266}
And lists:
poznan = [1711505, 163780, 932461, 1164703]
warszawa = [1503333, 93311, 93181, 93268, 106958, 106956, 127649, 106801, 107386, 93245, 154078, 107032]
sopot = [228481, 164126, 922891]
And now, if the user writes "poznan", I want to assign the poznan identifier from the dictionary to the variable "city_id", and then print the list with the name "poznan"