如何判断天气?整数小数点后的值是零
a = 17.3678
if a???:
print("the value after the decimal point is zero")
else:
print("the value after the decimal point is not zero")
如何判断天气?整数小数点后的值是零
a = 17.3678
if a???:
print("the value after the decimal point is zero")
else:
print("the value after the decimal point is not zero")
您可以使用拆分方法:
a = 17.3678
a = str(a)
valueAfterPoint = a.split('.')[1]
valueAfterPoint = int(valueAfterPoint)
if valueAfterPoint == 0:
print("the value after the decimal point is zero")
else:
print("the value after the decimal point is not zero")