Files
python-study/1. Number.py
김민구 30ef4cfbc7 1. 숫자형
2. 문자열
ex) 혼자 그냥 해본거
2021-04-26 16:58:27 +09:00

29 lines
406 B
Python

# 덧셈
print(4 + 7.0)
# 뺼셈
print(2.0 - 4)
# 곱셈
print(5.0 * 3.0)
# 나머지
print(7.0 % 3.0)
# 나눗셈(몫)
print(7.0 / 3.0)
# 거듭제곱
print(2.0 ** 3.0)
# floor division (버릴 나눗셈)
print(7 // 2)
# 버리고 소수형으로 표현
print(7.0 // 2)
# round (반올림)
print(round(3.1415926535))
# round (원하는 소수 자리에서 반올림)
print(round(3.1415926535, 2))