1. 숫자형

2. 문자열
ex) 혼자 그냥 해본거
This commit is contained in:
김민구
2021-04-26 16:58:27 +09:00
commit 30ef4cfbc7
4 changed files with 114 additions and 0 deletions

29
1. Number.py Normal file
View File

@@ -0,0 +1,29 @@
# 덧셈
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))