數(shù)據(jù)類型分三大類:整型,浮點型,虛數(shù)
>>>type(1)
<class 'int'>
>>>type(1.0)
<class 'float'>
使用type可以查看數(shù)據(jù)類型
虛數(shù):數(shù)字結(jié)尾帶j 即虛數(shù)
%f 截斷字符串
》》》print("%f" %(5/3))
1.67777
運行
在存放lee.py的目錄下運行命令:
C:\Users\michael\Downloads> python lee.py
數(shù)據(jù)類型分三大類:整型,浮點型,虛數(shù)
>>>type(1)
<class 'int'>
>>>type(1.0)
<class 'float'>
使用type可以查看數(shù)據(jù)類型
虛數(shù):數(shù)字結(jié)尾帶j 即虛數(shù)
%f 截斷字符串
》》》print("%f" %(5/3))
1.67777
運行
在存放lee.py的目錄下運行命令:
C:\Users\michael\Downloads> python lee.py