Skip to content

Instantly share code, notes, and snippets.

@leangaurav
Last active July 19, 2019 22:35
Show Gist options
  • Save leangaurav/fb9e0c3b7339f61e94387b98047e5791 to your computer and use it in GitHub Desktop.
Save leangaurav/fb9e0c3b7339f61e94387b98047e5791 to your computer and use it in GitHub Desktop.

wings.py

class Wings:
  def __str__(self):
    return "Wings"
    
  def fly(self):
    print("Flying /\\o/\\ ")

class ChickenWings:
  def __init__(self):
    self.price = 100
    
  def __str__(self):
    return "ChickenWings @{}".format(self.price)
    
  def fly(self):
    print("Can't!! I'm Dead")

Test Code

w1 = Wings()
c1 = ChickenWings()
print(w1)
print(c1)
w1.fly()
c1.fly()

Output
Wings
ChickenWings @100
*Flying /\o/*
Can't!! I'm Dead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment