diff --git a/__pycache__/myclass.cpython-314.pyc b/__pycache__/myclass.cpython-314.pyc new file mode 100644 index 0000000..555a424 Binary files /dev/null and b/__pycache__/myclass.cpython-314.pyc differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..4b82dd7 --- /dev/null +++ b/main.py @@ -0,0 +1,25 @@ +from myclass import Panda + +panda1 = Panda("Bamboozle","female",92,3,"sweet bamboo shoots") +panda2 = Panda("Nibblesworth","male",135,8,"bamboo leaves") +panda3 = Panda("Fluffernutter","female",105,5,"berries") +panda4 = Panda("Pandamonium","male",78,7,"honey") + + + +print(panda1.panda_info()) +print("Panda Status: ") +print(panda1.panda_status(),"\n") + +print(panda2.panda_info()) +print("Panda Status: ") +print(panda2.panda_status(),"\n") + +print(panda3.panda_info()) +print("Panda Status: ") +print(panda3.panda_status(),"\n") + +print(panda4.panda_info()) +print("Panda Status: ") +print(panda4.panda_status(),"\n") + diff --git a/myclass.py b/myclass.py new file mode 100644 index 0000000..2177643 --- /dev/null +++ b/myclass.py @@ -0,0 +1,27 @@ +class Panda: + def __init__(self,name,gender, weight, age, food): + self.name = name + self.gender = gender + self.weight = weight + self.age = age + self.food = food + + + def panda_info(self): + panda_info = f"Panda Information\n-----------\nname: {self.name}\ngender: {self.gender}\nweight: {self.weight}\nage:{self.age}\nfav food: {self.food}" + return panda_info + + def panda_status(self): + if self.age >= 4: + #adult + if self.weight > 125: + return "overweight" + elif self.weight < 85: + return "underweight" + else: + return "Average" + else: + return "panda is too young" + + + \ No newline at end of file