기록장
type 함수 본문
728x90
type 함수
파이썬으로 코딩을 하다 보면 쓰고 있는 값이
어떤 자료형인지 확실 하지 않을 때가 있음
그럴때 type를 써주면 어떤 자료형인지 확인 가능
print(type(3))
print(type(3.0))
print(type("3"))
<class 'int'>
<class 'float'>
<class 'str'>
def hello():
print("Hello")
print(type(hello))
print(type(print))
결과
<class 'function'>
<class 'builtin_function_or_method'>
built-in 내장되어 있는 함수
우리가 직접 정의한 함수가 아니라
파이썬에 기본적으로 내장되어 있는 함수라는 거
실행했을 때, True가 나오는 것을 모두 고르세요.
1
print(int(2.5) + int(3.8) > int(str(1) + str(2)))
2
print((12 >= 10 and not 3 > 4) or 3 ** 2 != 9)
3
print(True and (True or False))
4
print(not True or (True and False))
5
print(False == False)
정답은 2 3 5
728x90
'개발 > Python' 카테고리의 다른 글
Syntactic Sugar (0) | 2022.12.09 |
---|---|
옵셔널 파라미터 (0) | 2022.12.09 |
불린 (0) | 2022.12.07 |
불대수 (0) | 2022.12.07 |
문자열 포맷팅을 하는 다양한 방식 (0) | 2022.12.06 |
Comments