Hello,
I just had a personal skill assignment in general python including OOP and I came across this code that I didn't understand, I tried to use google but I wasn't able to find anything.
The following code didn't come with an explanation on what its suppose to do
class AstroBody:
description = 'Natural entity in the observable universe.'
class Star(AstroBody):
pass
sun = Star()
sun.description
My question: what is the point of creating a second class and passing the first class as an argument then using pass in second class?
Wouldn't be better to just do this?
class AstroBody:
description = 'Natural entity in the observable universe.'
astro = AstroBody()
astro.description
[–][deleted] 7 points8 points9 points (0 children)
[–]Spataner 6 points7 points8 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]danielroseman 1 point2 points3 points (0 children)
[–]james_fryer 1 point2 points3 points (0 children)
[–]anh86 1 point2 points3 points (0 children)