用户输入一个小数,用format格式化输出,保留3位小数。

a=float(input())
print("{:.3f}".format(a))

posted @ 2021-09-12 22:46  饭果果  阅读(2539)  评论(0)    收藏  举报