1. 숫자형
2. 문자열 ex) 혼자 그냥 해본거
This commit is contained in:
29
1. Number.py
Normal file
29
1. Number.py
Normal 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))
|
||||
Reference in New Issue
Block a user