格式化输出

a=float(input("请输入一个数:"))
print('{:.3f}'.format(a))

 

posted @ 2021-09-12 21:37  tan45  阅读(27)  评论(0)    收藏  举报