I have this code that iterates a text file, and each line will contain a companys name. I then want the loop to make a list with the name of that specific line. So let's say I have a file with: Volvo, Audi, BMW
Then the program will do something like the following:
for line in textfile:
line = []
So now I should have three empty lists: Volvo, Audi and BMW.
I'm sorry if this was confusing, what I'm really trying to ask is, is it possible to initialize a variable with a string name? lets say I have a string car = "volvo". Can I make a new variable, for example a list, with the name of the car object?