Create Your First Objects
Python
15 pts
Create Your First Objects
The class City is already written for you. Use it to:
- Create an object called
asmarawith the name"Asmara"and the region"Maekel". - Create an object called
massawawith the name"Massawa"and the region"Northern Red Sea". - Call
describe()onasmara, then onmassawa.
Expected output:
Asmara is in the Maekel region. Massawa is in the Northern Red Sea region.
Checklist
- Keep the
Cityclass and create an object calledasmarawith the name"Asmara"and the region"Maekel". - Create an object called
massawawith the name"Massawa"and the region"Northern Red Sea". - Call
describe()onasmara, then onmassawa.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
