I know this comment is a year old but: "p0: Point = Point()" is just instantiating the Point object and naming that point object "p0". The ": Point..." part is a type hint but not necessary. The line would do the same thing if it was just "p0 = Point()" the line "p0.x = 1.0" is redefining the value of attribute x in the p0 object just made. Its value was 0.0, but was changed to 1.0 in this line. You can access an objects attributes by typing the object name, a period, then the attribute name. So p0, period, then x. hope this helped
You've confused the purpose of dunder repr with that of dunder str. They are not the same and your usage and explanation of dunder repr here is incorrect. Best of luck.
Nice explanation of repr and magic methods. Thanks!
Your teaching is very gppd and easy to understand, love it!
Thanks!
@@KrisJordan You are a God tier teacher, I wish I was in your class
This is so helpful!! Pls keep uploading new videos :D
Your videos are as outstanding as always. Thanks Kris.
Thank you for your great video. One thing is confusing for me. You have used f"...." as the string. What type of string is it?
Search for Python format/formatted string and you'll find quality introductions to it. They're great!
Understood everything, except what is p0: Point = Point() and p0.x = 1.0.? like what is the Point doing and what is p0.x? so lost
I know this comment is a year old but:
"p0: Point = Point()" is just instantiating the Point object and naming that point object "p0". The ": Point..." part is a type hint but not necessary. The line would do the same thing if it was just "p0 = Point()"
the line "p0.x = 1.0" is redefining the value of attribute x in the p0 object just made. Its value was 0.0, but was changed to 1.0 in this line. You can access an objects attributes by typing the object name, a period, then the attribute name. So p0, period, then x.
hope this helped
how are you, man!
You've confused the purpose of dunder repr with that of dunder str.
They are not the same and your usage and explanation of dunder repr here is incorrect.
Best of luck.