push
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
class Plant:
|
||||
def __init__(self, name, heigt, age):
|
||||
self.name = name
|
||||
self.heigt = heigt
|
||||
self.age = age
|
||||
|
||||
|
||||
def get_info(rose):
|
||||
print(rose.name, rose.heigt, "cm,", rose.age, "days old")
|
||||
|
||||
|
||||
def ft_plant_growth():
|
||||
rose = Plant("Rose", 25, 30)
|
||||
print("=== Day 1 ===")
|
||||
get_info(rose)
|
||||
rose.heigt += 6
|
||||
rose.age += 6
|
||||
print("=== Day 7 ===")
|
||||
get_info(rose)
|
||||
print("Growth this week: +6cm")
|
||||
|
||||
|
||||
ft_plant_growth()
|
||||
Reference in New Issue
Block a user