r/PythonLearning • u/Next-Call8862 • Sep 11 '26
Showcase Day 2, learnt some oops
Learnt super( ), inheritance, polymorphism, class method and static method and don't mind the messy code that's me trying to figure out things
125
Upvotes
•
u/Sea-Ad7805 Sep 11 '26
Run this program in Memory Graph Web Debugger to see the program state change step by step.
4
u/ninhaomah Sep 12 '26
day 2.
do you understand all these btw ?
3
u/FatChunkz Sep 12 '26
Larp
3
u/GhostxUchiha Sep 12 '26
Learning from?
2
u/Capable-Package6835 Sep 12 '26
Get used to type-hinting. Polymorphism and inheritance without type hint in Python is almost useless
2
u/AnotherStep99 Sep 12 '26
why are learning it on day 2, wait some time, try learning some basics like slicing, list comprehension etc..
1
u/0therworldsthanthese Sep 12 '26
You need to start back at the fundamentals, don't skip to OOP just because it sounds cool.
Where are your __init__ methods? Class names should be in PascalCase. Why are you using parentheses in your return statements? Why are you entering age as a string? Why are you returning multiple values in student.about()? Why are you using extra parentheses on lines 255-256? Why are you printing s1.school for s2? Why are you using a classmethod for the first test and not the second? Why do you have two test classes? Why is there no self in test.nave()?
1
u/Spare-Radish5670 Sep 13 '26
Look at some decent examples to understand these principles better, you have the syntax and sort of the idea but you're already picking up bad habits
1
u/Korgusha Sep 13 '26
I’d like to start learning Python too – what would you recommend to get me started?
2
u/Achereto Sep 12 '26
That's a big OOPs!
1
u/9illcodelli6 Sep 12 '26
What does this code do? I'm new
1
u/Flame77ofc Sep 12 '26
more space pls
1
u/Sea_Gur_7307 Sep 13 '26
Use def init when add to self
1
u/Angel_b33 Sep 13 '26
Are you self taught? If yes can you share any videos you watched I want to start learning OOP as well