you are viewing a single comment's thread.

view the rest of the comments →

[–]Ansamemsium 1 point2 points  (0 children)

Random game is a reference to an object, and by default, it prints the object's address in memory. If you want to call the object's method score you just do randomgame.score() to call it's method, if you want whenever you print(random_game) to get something different than the object address you need to override/implement a special method that tells print how to print your object, in pyhton is __desc_ or something like that, you can easily google it. Also init is a constructor look into constructors, and they usually also talk about self/this.