반응형
number = 9
print(type(number)) # 변수 "number"의 타입을 프린트 하기
float_number = 9.0
print(float_number) # 변수 "float_number"를 프린트 하기
print(int(float_number)) # 변수 "float_number"의 타입을 int(정수) 로 바꾼 다음 변수를 프린트 하기
산출물 (Output)
<class 'int'>
9.0
9
반응형
'Python 배우기' 카테고리의 다른 글
할당 assignments.py (0) | 2016.03.06 |
---|---|
연산자 arithmetic_operators.py (0) | 2016.03.06 |
변수_타입 variable_type.py (0) | 2016.03.06 |
변수_정의 variable_definition.py (0) | 2016.03.06 |
Python Object and Classes 파이썬 객체와 클래스 (0) | 2016.03.05 |
댓글