Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 526 Bytes

Object-oriented-programming-platypus-1-Python.md

File metadata and controls

21 lines (18 loc) · 526 Bytes
layout topic title language
exercise
Object Oriented Programming
Platypus 1
Python

We're experimenting with platypus (platypi?). During the breeding season, each platypus will lay a certain number of eggs. We want to model the platypus and keep track of how many eggs they've laid each season.

Design a class, Platypus, that takes the name of the platypus and a list containing the number of eggs laid each season. For example,

>>> perry = Platypus("perry", [3, 2, 4, 1, 2])\
>>> perry.name
"perry"
...