with open('test3.txt','w',encoding='utf-8') as f: print('this is test3.txt',file=f) #用print 输出到文件
a=int(input('number:')) b= a if a>4 else 3 # 条件表达式简化 print(b)