LearnPy Hub
← Classes & Objects problems
Easy

Rectangle Class

Write a Rectangle class with width and height, and methods area() and perimeter(). Read w and h and print both.

Input

Two integers.

Output

Two lines.

Sample 1

Input
3
4
Output
12
14

Sample 2

Input
1
1
Output
1
4
solution.py
Output appears here
Rectangle Class · Python practice problem · LearnPy Hub