Skip to content

Instantly share code, notes, and snippets.

@JackInTaiwan
Created October 17, 2018 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JackInTaiwan/c2da0fb1d4c33344db7680c0ce9c2bd5 to your computer and use it in GitHub Desktop.
Save JackInTaiwan/c2da0fb1d4c33344db7680c0ce9c2bd5 to your computer and use it in GitHub Desktop.
class Shiba:
pee_length = 10
def __init__(self, height, weight):
self.height = height
self.weight = weight
@classmethod
def pee(cls):
print("pee" + "." * cls.pee_length)
Shiba.pee()
#result: pee..........
black_shiba = Shiba(30, 40)
black_shiba.pee()
#result: pee..........
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment