首页 > 技术文章 > python 除法总返回浮点
stono 2018-03-05 18:08 原文
python 除法总返回浮点,要返回整型需要用//;
print(type(4/2),type(4//2)) #<class 'float'> <class 'int'>