클래스2

송용진·2023년 7월 19일
0
class Car:
    def __init__(self,brand,year):
      self.brand = brand
      self.year = year
    def show_info(self):
      print("Brand:",self.brand)
      print("Year:",self.year)
      

my_car = Car('Toyota', '2020')

my_car.show_info()
# 출력
# Brand: Toyota
# Year: 2020
profile
개발자

1개의 댓글

comment-user-thumbnail
2023년 7월 19일

이 글은 저에게 많은 도움이 되었습니다.

답글 달기