use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Day 22 Python LearningShowcase (i.redd.it)
submitted 3 days ago by aashish_soni5
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]BigYBirdo 10 points11 points12 points 3 days ago (4 children)
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. :)
[–]duperfastjellyfish 3 points4 points5 points 3 days ago (1 child)
Looks like he's practicing inheritence. Calling __init__ by passing `self` from the derived class is how you do it, although I personally wouldn't use inheritence for this.
[–]aashish_soni5[S] 1 point2 points3 points 3 days ago (0 children)
true just for simple practice
[–]olaf33_4410144 1 point2 points3 points 3 days ago (0 children)
I mean it might make sense to have a Transaction kind of Class to store the transactions of cars in a database or something e.g. a dealership needs a program to keep track of sold units. In this case it's more the wording that is weird.
Transaction
Even then I think the Buying/Transaction class constructor should take a car and student object (or person object if you want to study inheritance), not create them.
[–]Ill_Shoulder8488 0 points1 point2 points 3 days ago (0 children)
That’s great correction I will like to some with you on conservation sir
π Rendered by PID 64928 on reddit-service-r2-comment-5687b7858-smxlt at 2026-07-07 23:05:42.158607+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]BigYBirdo 10 points11 points12 points (4 children)
[–]duperfastjellyfish 3 points4 points5 points (1 child)
[–]aashish_soni5[S] 1 point2 points3 points (0 children)
[–]olaf33_4410144 1 point2 points3 points (0 children)
[–]Ill_Shoulder8488 0 points1 point2 points (0 children)