摘要: 直接上代码~~ #coding=utf-8 # 主要练习输入&输出+异常捕捉,熟悉基本程序流 import os for a in range(1, 4): try: high = float(input("输入你的身高(m):")) weight = float(input("输入你的体重(kg) 阅读全文
posted @ 2022-05-10 17:14 平行时空的旅者 阅读(915) 评论(0) 推荐(0) 编辑
摘要: pprint.pprint()函数将列表或字典中的内容“漂亮打印”到屏幕,而 pprint.pformat()函数可以使字符串更加容易阅读,同时字符串也是正确的python代码。 这样就可以用pformat来生成python文件给别的文件调用。如下: from pprint import pform 阅读全文
posted @ 2022-05-10 14:27 平行时空的旅者 阅读(175) 评论(0) 推荐(0) 编辑