diff --git a/__pycache__/panda.cpython-315.pyc b/__pycache__/panda.cpython-315.pyc new file mode 100644 index 0000000..b44c9b1 Binary files /dev/null and b/__pycache__/panda.cpython-315.pyc differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..729e548 --- /dev/null +++ b/main.py @@ -0,0 +1,17 @@ +from panda import Panda + +panda1 = Panda("Po", 5, 100, "Black & White") +panda2 = Panda("Luna", 3, 110, "Black & White") +panda3 = Panda("Lili", 7, 120, "White") +panda4 = Panda("Snow", 4, 90, "White") + + +print(panda1.name) +print(panda2.name) +print(panda3.name) +print(panda4.name) + + +panda1.eat() +panda2.sleep() +panda3.description() \ No newline at end of file diff --git a/panda.py b/panda.py new file mode 100644 index 0000000..d3a9bcf --- /dev/null +++ b/panda.py @@ -0,0 +1,17 @@ +class Panda: + def __init__(self, name, age, weight, color): + self.name = name + self.age = age + self.weight = weight + self.color = color + + def eat(self): + print(self.name, "is eating bamboo") + + def sleep(self): + print(self.name, "is sleeping") + + def description(self): + print("Your panda's information: ") + info = f"panda's name is : {self.name}, age is : {self.age}, weight is : {self.weight}, color: {self.color}" + print(info) \ No newline at end of file