If you use a class in Python, the member function in the class must first use self, which means itself, as the parameter. (Exception is that a class function, for example, has the characteristics of a static function in java.)
If you do not use the class, there are no rules for the first factor.
Perhaps the views in the tutorial defined a function for the view without using the class.
© 2024 OneMinuteCode. All rights reserved.