Let's suppose I have a list of strings:
people = ['Mike','Paul','Caroline']
and a class:
class Person:
def __init__(self, name, is_married = False):
self.name = name
self.is_married =is_married
How can i iterate through the strings in the list, and for each string create an instance of Person? Ideally, I would like to be able to call each instance through their name (the string), for example:
Mike.is_married = True
print(Mike.is_married)