執行 ❯
擁有你自己的 Python 伺服器
×
更改方向
更改主題,深色/淺色
前往 Spaces
#convert from int to float: x = float(1) #convert from float to int: y = int(2.8) #convert from int to complex: z = complex(1) print(x) print(y) print(z) print(type(x)) print(type(y)) print(type(z))
1.0
2
(1+0j)
<class 'float'>
<class 'int'>
<class 'complex'>