본문으로 바로가기

내장함수

category onYouTube/Python 2021. 3. 15. 20:49
  • input : 사용자 입력을 받는 함수
language = input("어떤 언어를 좋아하세요? ")
print("{0}은 아주 좋은 언어입니다!".format(language))

 

  • dir : 넘겨받은 객체가 어떤 변수와 함수를 가지고 있는지 표시
#case1
print(dir())


#case2
import random
print(dir())


#case3
import pickle
print(dir())

#case4
print(dir(random))


#case5
lst = [1, 2, 3]
print(dir(lst))


#case6
name = "Soo"
print(dir(name))

 

- list of python builtins를 구글링하면, 파이썬에서 사용할 수 있는 내장 함수를 확인할 수 있음

'onYouTube > Python' 카테고리의 다른 글

외장함수  (0) 2021.03.15
패키지  (0) 2021.03.15
모듈  (0) 2021.03.15
Finally  (0) 2021.03.14
에러 발생시키기  (0) 2021.03.14