摘要:
函数 1 Type hinting # Type hinting def add(x: int, y: int) -> int: res = x + y return res print(add.__annotations__) # {'x': <class 'int'>, 'y': <class 阅读全文
摘要:
文件处理 1 文件打开模式补充 with open('a.txt', mode='r+t', encoding='utf-8') as f: print(f.read()) print(f.writable()) print(f.readable()) f.write("你好") with open 阅读全文