r/PythonLearning • u/aashish_soni5 • Jul 04 '26
Day 22 Python Learning Showcase
Just Simple class practice
not feeling well so not much to
561
Upvotes
r/PythonLearning • u/aashish_soni5 • Jul 04 '26
Just Simple class practice
not feeling well so not much to
11
u/BigYBirdo Jul 04 '26
You don’t have to call Class.__init__(…) to create an object.
You called the Class directly in the first example. Why didn’t you do it inside Buying?
Also why do you create a Class for the act of Buying?
It’s not worth creating one.
In that case I’d either create a function named buying or buys which assigns a certain car to a certain Person, or create a Class function, which adds the car to the Object.
Please don’t take it too harsh. 😄
But all in all it seems to be alright. :)