Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- info = [
- {"Website": "Facebook", "Email": "[email protected]", "Password": "a1231123"},
- {"Website": "Febook", "Email": "ibqewmail.com", "Password": "a123123"},
- {"Website": "Facook", "Email": "[email protected]", "Password": "a1231weqwerwag23"}
- ]
- def add_account():
- web = input("Enter website name: ").capitalize()
- email = input("Enter email: ").lower()
- password = input("Enter password: ")
- info.append({"Website": web, "Email": email, "Password": password})
- def view_account():
- print()
- for i in info:
- print("Website: " + i["Website"])
- print("Email: " + i["Email"])
- print("Pass: " + i["Password"])
- print()
- print("Total accounts: " + str(len(info)))
- print()
- def search_account():
- to_search = input("Enter web name: ").capitalize()
- for i in info:
- if i["Website"] == to_search:
- print("Website: " + i["Website"])
- print("Email: " + i["Email"])
- print("Pass: " + i["Password"])
- print()
- break
- else:
- print("Not found.\n")
- def delete_account():
- website = input("Enter web name: ").capitalize()
- for i in info:
- if i["Website"] == website:
- email = input("Enter email: ").lower()
- if i["Email"] == email:
- info.remove(i)
- print("Account deleted.\n")
- break
- else:
- print("Wrong email.\n")
- break
- else:
- print("Website not found.\n")
- def update_account():
- website = input("Enter web name: ").capitalize()
- for i in info:
- if i["Website"] == website:
- email = input("Enter email: ").lower()
- if i["Email"] == email:
- new_pass = input("Enter new password: ")
- i["Password"] = new_pass
- print("Account updated.\n")
- break
- else:
- print("Wrong email.\n")
- break
- else:
- print("Website not found.\n")
- while True:
- print("1. Add")
- print("2. View")
- print("3. Search")
- print("4. Update")
- print("5. Delete")
- print("6. Exit")
- selected = input("Select: ")
- print()
- if selected == "1":
- add_account()
- elif selected == "2":
- view_account()
- elif selected == "3":
- search_account()
- elif selected == "4":
- update_account()
- elif selected == "5":
- delete_account()
- elif selected == "6":
- print("\nThank you for using our program!!! :)")
- break
- else:
- print("INVALID INPUT!!!\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement