TORONTO KIDS COMPUTER CLUB | Wednesday 17:00 Python Practice – 22.07.27.
20902
post-template-default,single,single-post,postid-20902,single-format-standard,ajax_fade,page_not_loaded,,no_animation_on_touch,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Wednesday 17:00 Python Practice – 22.07.27.

01 Aug Wednesday 17:00 Python Practice – 22.07.27.

Question:
Write a Rectangle class in Python language, allowing you to build a rectangle with length and width attributes.
Create a getPerimeter() method to calculate the perimeter of the rectangle and an getArea() method to calculate the area of ​​the rectangle.
Use print to show the length, width, perimeter and area of an object created using an instantiation on rectangle class.

No Comments

Sorry, the comment form is closed at this time.