print("to add two no.") a=int(input("Enter 1st no. ") b=int(input("Enter 2nd no. ") c=a+b with open("tt.txt","a") as fp: fp.write("The result of addition of two numbers is ") fp.write(str(a)+"and"+str(b)+"is") fp.write(str(c))