Exercise: Cats Everywhere

Run Settings
LanguagePython
Language Version
Run Command
class Cat: species = 'mammal' def __init__(self, name, age): self.name = name self.age = age mycat1 = Cat('boots',2) mycat2 = Cat('lucy',5) mycat3 = Cat('tom',7) def old_cat(cat1, cat2, cat3): if cat1.age > cat2.age and cat3.age: old_cat = "the oldest cat is", cat1.name, "with age of", cat1.age if cat2.age > cat1.age and cat3.age: old_cat = "the oldest cat is", cat2.name, "with age of", cat2.age, "years" else: old_cat = "the oldest cat is", cat3.name, "with age of", cat3.age, "years" print(old_cat)
Editor Settings
Theme
Key bindings
Full width
Lines