Python Challenge 5일차 TIL

손한주·2023년 3월 10일

개요 : 언더독레볼루션 입부를 위한 시험과제, 5일차까지 있으며 기본적인 파이썬을 공부한다

1.인스턴스


(실습2)

list1 = list(range(10))
list2 = [1, 2, 3]
if isinstance( list1 , list) and isinstance( list2 , list):
print("list1과 list2는 둘 다 list클래스 입니다.")

2.클래스


(실습)

class Car():
'''자동차'''
taxi = Car()
taxi.name = "택시"

3.모델링

(모델링에 대한 실습이 없다..)

4.메소드


(실습)

class Car():
'''자동차'''
def run(self):
print("{}가 달립니다.".format(self.name))
taxi = Car()
taxi.name = "택시"
taxi.run()

완강인증!


(완강인증샷)

profile
호랑이!

0개의 댓글