Q. Write a program to append more details to file "phonebook.det".

 

Answer = 

 

f = open("phonebook.det ","a")
while True :
    name = input("Enter name :-")
    phone = input("Enter Phone :-")
    f.write(name +"\t")
    f.write( phone + "\t")
    f.write("\n")
    user = input("Enter quit or continue (Q/C) :-")
    if user == "Q" or user == "q":
        break
f.close()
print("Thankyou")

 

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post