摘要: 摘自官网:https://docs.python.org/zh-cn/3.7/tutorial/errors.html # 处理异常 try...expect...else(可选) while True: try: user_input = int(input('请输入一个数字按下回车:')) br 阅读全文
posted @ 2020-07-18 23:45 zy7y 阅读(146) 评论(0) 推荐(0) 编辑
摘要: # 格式化字符串: 在字符串前加上 f 或者 F 使用 {变量名} 的形式来使用变量名的值 year = 2020 event = 'Referendum' value = f'Results of the {year} {event}' print(f'Results of the {year} 阅读全文
posted @ 2020-07-18 23:13 zy7y 阅读(1266) 评论(0) 推荐(0) 编辑