This may be a simple question but I haven't found the answer to this online anywhere. I want to take an argument or input and use that name to create an instance of a class. Is that possible?
Example:
def make_instance(argument):
# argument = Something() | example if argument = "one", then
# make instance would create--> one = Something()
# and I could do one.do_anything
class Something:
def do_anything():
print("anything")
Is this possible? Interpret the content of an argument and use it to create an instance of a class or a variable or anything for that matter. So long as the contents of the argument, whether int or str, becomes the name of the instance of class or name of variable?