728x90
number
-
[Python tutorial] 4. Data type - Numbers코딩/Python 2022. 12. 21. 17:11
Numbers int float complex Integer: int x = 1 y = 100 z = -300 Float x = 1.10 y = 1.0 z = -35.59 a = 35e3 # scientific numbers with an "e" b = 12E4 c = -87.7e100 Complex x = 3+5j y = 5j z = -5j Type Conversion int(), float(), complex() x = 1 # int y = 2.8 # float z = 1j # complex, 다른 타입으로 변환 불가 a = float(x) # 1.0 b = int(y) # 2 c = complex(x) # (1+0j) Random Number: random() Random module referen..