숫자 데이터 타입

Python의 데이터 타입

Jason Myers

Instructor

내장 숫자 타입

정수

  • 정수값
  • 큰 값 처리
int(123456789123456789)
123456789123456789

부동소수점

  • 소수(근사)
  • 과학적 표기법
float(123456789123456789)
1.2345678912345678e+17
Python의 데이터 타입

Decimal

  • 정확한 정밀도
  • 통화 계산에 적합
from decimal import Decimal
Decimal('123456789123456789')
Decimal('123456789123456789')
Python의 데이터 타입

실수 출력

print(0.00001)
1e-05
print(f"{0.00001:f}")
0.000010
Python의 데이터 타입

실수 출력

print(f"{0.0000001:f}")
0.000000
print(f"{0.0000001:.7f}")
0.0000001
Python의 데이터 타입

Python 나눗셈 유형

4/2
2.0
4//2
2
7//3
2
Python의 데이터 타입

연습해 봅시다!

Python의 데이터 타입

Preparing Video For Download...