1 f = open("20201212.txt", "w") 2 f.write ("20201212") 3 4 f=open("20201212.txt","r") 5 print(f.read()) 6 f.close() 7 8 f=open("20201212.txt","r") 9 n=f.read() 10 a=0 11 for i in n: 12 a=a+int(i) 13 print(a) 14 b=bin(a) 15 print(b) 16 f=open("20201212b.txt","w") 17 f.write(b) 18 f.close()