Compressing list[0], list[1], list[2],... into a simple statement
Unpack the list with the *args
notation.
x = Classname(*listname)
You could use
listname = [1, 2, 3, 4, 5]
class Classname:
def __init__(self, *args):
print(args)
x = Classname(*listname)