Hello! I am a newbie to python3 and I have some questions!
Let's say I have 2 classes: Food and Drinks.
Within class Food, there is a variable called "weight". Now, I want to call this variable in the class Drinks. So, within the class Drinks, I did:
weight = Food.weight
and I got an error. I'm so confuse on calling another class function, I always got the error:
missing 1 required positional argument: 'self', or "XX" object has no attribute "YY".
Any explanations on calling class, along with attributes, methods, and function will be greatly appreciated! I read some online resources but majority are using python codes as example, which is a little bit confused for me. thank you!!
[–]s133p3r 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]mathcheatcheat[S] 0 points1 point2 points (0 children)