diff --git a/__pycache__/panda.cpython-314.pyc b/__pycache__/panda.cpython-314.pyc new file mode 100644 index 0000000..410b30c Binary files /dev/null and b/__pycache__/panda.cpython-314.pyc differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..f85822a --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +from panda import Panda + +panda1=Panda("leo",4,"black",78) +panda2=Panda("kioo",9,"bwhite",98) +panda3=Panda("sho",4,"blue",48) +panda4=Panda("ali",4,"green",79) + +print(panda1.name) +print(panda2.name) +print(panda3.name) +print(panda4.name) + +for panda in [panda1,panda2,panda3,panda4]: + print(panda.introduce()) + print(panda.eat_tree()) \ No newline at end of file diff --git a/panda.py b/panda.py new file mode 100644 index 0000000..4d792ea --- /dev/null +++ b/panda.py @@ -0,0 +1,13 @@ +class Panda: + def __init__(self,name:str,age:int,weight:float,color:str) -> None: + self.name=name + self.age=age + self.weight=weight + self.color=color + + def introduce(self) -> self: + return f"Hello ,my name is {self.name}i am a {self.color}, and i am {self.age}year old" + + def eat_tree(self)->self: + return f"{self.name}is eating tree" + \ No newline at end of file