Dec-12-2019, 08:26 PM
Since this is basically a collection of key-value pairs (website to password), you could also use a dict, and then use
dict.pop()
to remove them.>>> sites = {"yahoo": "yahoo_password", "google": "spam-is-Ta$ty"} >>> sites {'yahoo': 'yahoo_password', 'google': 'spam-is-Ta$ty'} >>> "yahoo" in sites True >>> sites.pop("yahoo") 'yahoo_password' >>> sites {'google': 'spam-is-Ta$ty'}