2016-01-23 155 views

回答

4

嘗試使用格式字符串:

print("%.6f"%4.0) # 4.000000 

或者:

print("{:.6f}".format(4.0)) 

對格式字符串和更多示例詳見the Python documentation