클래스4

송용진·2023년 7월 19일
0
class Rectangle:
  def __init__(self,w,h):
    self.w=w
    self.h=h
  def calculate_area(self):
    return self.w*self.h    

my_rectangle = Rectangle(5, 7)
print(my_rectangle.calculate_area()) # 사각형의 너비를 반환
# 출력 : 35
profile
개발자

1개의 댓글

comment-user-thumbnail
2023년 7월 19일

유익한 글 잘 봤습니다, 감사합니다.

답글 달기