Here is the code to start with.
Ignoring all the CSV jazz if you want, the important part is the loop.
import csv
Teacher_Array = []
class Teacher:
def __init__ (self, login, password, name, room, booked):
self.password = password
self.name = name
self.login = login
self.booked = booked
self.room = room
with open('file.csv') as f:
reader = csv.reader(f)
for row in reader:
if len(row) < 10 and len(row) > 2:
Ok.
The cvs stuff is a little besides the point, the key info is the loop, how do I create different variable names each time?
At this point I want to create teacher objects say,
MrDongle = Teacher(row[0], row[1], row[3], etc)
However I can't make a new name in the loop! Help please.
Much love, some dumb teenager.