Advertisement
IMustRemainUnknown

Account Manager

Dec 14th, 2023
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | Source Code | 0 0
  1. info = [
  2. {"Website": "Facebook", "Email": "[email protected]", "Password": "a1231123"},
  3. {"Website": "Febook", "Email": "ibqewmail.com", "Password": "a123123"},
  4. {"Website": "Facook", "Email": "[email protected]", "Password": "a1231weqwerwag23"}
  5. ]
  6.  
  7.  
  8. def add_account():
  9. web = input("Enter website name: ").capitalize()
  10. email = input("Enter email: ").lower()
  11. password = input("Enter password: ")
  12.  
  13. info.append({"Website": web, "Email": email, "Password": password})
  14.  
  15.  
  16. def view_account():
  17. print()
  18. for i in info:
  19. print("Website: " + i["Website"])
  20. print("Email: " + i["Email"])
  21. print("Pass: " + i["Password"])
  22. print()
  23.  
  24. print("Total accounts: " + str(len(info)))
  25. print()
  26.  
  27.  
  28. def search_account():
  29. to_search = input("Enter web name: ").capitalize()
  30.  
  31. for i in info:
  32. if i["Website"] == to_search:
  33. print("Website: " + i["Website"])
  34. print("Email: " + i["Email"])
  35. print("Pass: " + i["Password"])
  36. print()
  37. break
  38. else:
  39. print("Not found.\n")
  40.  
  41.  
  42. def delete_account():
  43. website = input("Enter web name: ").capitalize()
  44.  
  45. for i in info:
  46. if i["Website"] == website:
  47. email = input("Enter email: ").lower()
  48. if i["Email"] == email:
  49. info.remove(i)
  50. print("Account deleted.\n")
  51. break
  52. else:
  53. print("Wrong email.\n")
  54. break
  55. else:
  56. print("Website not found.\n")
  57.  
  58.  
  59. def update_account():
  60. website = input("Enter web name: ").capitalize()
  61.  
  62. for i in info:
  63. if i["Website"] == website:
  64. email = input("Enter email: ").lower()
  65. if i["Email"] == email:
  66. new_pass = input("Enter new password: ")
  67. i["Password"] = new_pass
  68. print("Account updated.\n")
  69. break
  70. else:
  71. print("Wrong email.\n")
  72. break
  73. else:
  74. print("Website not found.\n")
  75.  
  76.  
  77. while True:
  78. print("1. Add")
  79. print("2. View")
  80. print("3. Search")
  81. print("4. Update")
  82. print("5. Delete")
  83. print("6. Exit")
  84.  
  85. selected = input("Select: ")
  86. print()
  87.  
  88. if selected == "1":
  89. add_account()
  90. elif selected == "2":
  91. view_account()
  92. elif selected == "3":
  93. search_account()
  94. elif selected == "4":
  95. update_account()
  96. elif selected == "5":
  97. delete_account()
  98. elif selected == "6":
  99. print("\nThank you for using our program!!! :)")
  100. break
  101. else:
  102. print("INVALID INPUT!!!\n")
  103.  
  104.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement