05 2022 档案

摘要:def is_valid(x): if len(x)!=18: return False for i in x: if not (i.isdigit() or i=='X'): return False else: return True with open('data3_id.txt','r',e 阅读全文
posted @ 2022-05-22 09:34 杜雨萱 阅读(64) 评论(2) 推荐(0)
摘要:with open('data3.txt','r',encoding='utf-8') as f : with open('data3_processed.txt', 'w', encoding='utf-8') as f1: data=f.read().strip().split('\n') da 阅读全文
posted @ 2022-05-15 11:35 杜雨萱 阅读(45) 评论(1) 推荐(0)
摘要:实验一:print(sum) sum = 42 print(sum) def inc(n): sum = n+1 print(sum) return sum sum = inc(7) + inc(7) print(sum) 问题:1.内置函数2.全局变量3.局部变量4.全局变量 实验二: def f 阅读全文
posted @ 2022-05-08 19:31 杜雨萱 阅读(48) 评论(2) 推荐(0)