#sample solution
#Creating a class
class Bottle:
def __init__(self, liquid):
self.amount= 500
self.height = 10
self.empty = False
self.full = True
self.liquid = liquid
def amount_left(self):
return self.amount
# your code here
def drink(self, amountDrank):
self.amount -= amountDrank
#check
newBottle = Bottle("water")
print newBottle.amount_left()
newBottle.drink(200)
print newBottle.amount_left()
No comments:
Post a Comment