Last answered:

07 Dec 2021

Posted on:

07 Dec 2021

0

Creating new variables directly into the method

The instructor created a list variable called condition in the _init_ method but he didn't declare it alongside self, name and age in the bracket. Can we create new variables directly into the method without declaring them in the parameters list?

1 answers ( 0 marked as helpful)
Posted on:

07 Dec 2021

0

There's no need to pass something in, if it's going to have the same starting value for every object you create.

The method is __init__, not _init_.

Submit an answer