Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Delete_con():
- contact_to_delete= input("choose name to delete from contact")
- with open("phonebook1.txt", "r+") as file:
- content = file.readlines()
- file.seek(0)
- for line in content:
- if not any(contact_to_delete in line):
- file.write(line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement