Commit 2a296546 authored by Børge Haugset's avatar Børge Haugset
Browse files


parent cba5fd85
# Gå til bb, gamle eksamener, fyr opp kont2018
# Den med passord og fotballskår.
notebook = {}
def addSite(notebook):
site = input('Site: ')
if site in notebook:
print(f'{site} er allerede lagret.')
return notebook
username = input("brukernavn: ")
password = input("passord: ")
notebook[site] = [username,[password]]
return notebook
notebook = {'facebook': ['urgle', ['pwd','newpass']], \
'vgeretfrykteligkortnavn': ['user', ['pwd2']], \
'db': ['nah', ['pwd']]}
def showSites(notebook):
for site, values in notebook.items():
def formatList(liste):
return ", ".join(liste)
print(formatList([str(i) for i in range(10)]))
def editSite(notebook, site):
while True:
password = input(f'Add new password for {site}: ')
if password in notebook[site][1]:
print(f"'{password}' has been used for {site} already.")
print(f'The following passwords have been used: {formatList(notebook[site][1])}.')
return notebook
editSite(notebook, 'facebook')
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment