セクション 1. 章 5
single
Challenge: Creating and Using Methods
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Create a class that represents a rectangle and implements methods to calculate its area and perimeter.
- Define a class named
Rectangle. - Add an
__init__method that takeswidthandheightas arguments and stores them as instance variables. - Implement a method called
areathat returns the area of the rectangle. - Implement a method called
perimeterthat returns the perimeter of the rectangle.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 5
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください