I was given this project to work on in class and the one major issue that I'm having trouble with is getting the first indexes of each list from a text file separated into their own category and creating an indefinite list of said category. The first indexes are supposed to be their own data set for the user to choose from, and this will be applied regardless of how many lists there will be.
An example of this would be taking a text file such as this:
Silver Lake, 32, 35, 25
Pasadena, 55, 75, 20
Los Angeles, 3500, 3000, 500
and being able to categorize it as:
The cities in our available data set:
A - City 1
B - City 2
C - City 3
Please select your status: A
Where the data set could be expanded with the options selection input automatically adjusting to it I've only managed to get this far:
def title():
print("City Population Projector")
print("Select a city from the list: ")
def list():
with open("population.txt", "r") as projections:
cities = projections.read()
print(cities)
if __name__ == "__main__":
title()
list()