

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Inheritance
incomplete
2: When to Inherit
incomplete
3: Inheritance Hierarchy
incomplete
4: Inheritance Quiz
incomplete
5: Multiple Children
incomplete
6: Adding a Wizard
incomplete
7: Wide Not Deep
incomplete
8: Dragons
incomplete
9: Dragons Fight
incomplete
10: Inheritance Practice
incomplete
11: Inheritance Practice
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
You discovered that to properly calculate army formations in the game, you needed to be able to get the area and perimeter of squares and rectangles of various sizes.
A rectangle's perimeter is the total distance around its four sides: two lengths plus two widths, or 2 * (length + width).
Complete the Rectangle and Square classes. All squares are rectangles, but not all rectangles are squares.
Because Square inherits Rectangle's methods, it should only need to implement __init__.