I have 3 classes as such:
class Year1(Student):
def action():
...
class Year2(Student):
def action():
...
class Year3(Student):
def action():
...
How can I instantiate those objects from a list of tuples of their string names and integer values like this :
ls = [('Year1', 10), ('Year2', 15), ('Year3', 25)]
to this:
years = [Year1(10), Year2(15), Year3(25)]
This question didn't help me solve the problem.