a guest Mar 25th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- class Fruit(object):
- """A class that makes various tasty fruits."""
- def __init__(self, name, color, flavor, poisonous):
- self.name = name
- self.color = color
- self.flavor = flavor
- self.poisonous = poisonous
- def description(self):
- print "I'm a %s %s and I taste %s." % (self.color, self.name, self.flavor)
- def is_edible(self):
- if not self.poisonous:
- print "Yep! I'm edible."
- print "Don't eat me! I am super poisonous."
- lemon = Fruit("lemon", "yellow", "sour", False)
RAW Paste Data