Missing 1 required positional argument

You have not actually created an object yet.

For instance, you would want to write:

first = classname()

instead of just

first = classname

At the moment, how you wrote it, first is pointing to a class. E.g., if you ask what first is, you’d get:

<class '__main__.classname'>

However, after instantiating it (by simply adding the () at the end), you’d see that first is now:

<__main__.classname object at 0x101cfa3c8>

The important distinction here is that your call set first as a class, whereas mine set it as an object.

Think about it like this: A class is to an object as humankind is to you, or as canine is to Lassie.

You set it as “canine”, whereas you wanted to set it as “Lassie”.


Note: you also usually want to initialize your objects. For that, you place an __init__ method in your class.

Leave a Comment