Skip to content
Snippets Groups Projects
Commit e529c3db authored by Annukka Heinonen's avatar Annukka Heinonen
Browse files

Upload New File

parent b5395e7a
No related branches found
No related tags found
No related merge requests found
def salaus ():
oikea = "salasana1"
indeksi = 3
while True:
salaus = input(f"({indeksi} yritystä) Anna salasana: ")
if salaus == "salasana1":
print("Oikea salasana!")
break
elif salaus != "salasana1" and indeksi > 1:
indeksi -= 1
print(f"Väärä salasana! Yrityksiä jäljellä {indeksi}.")
else:
print("Salasana väärä! palaa aloitukseen")
break
salaus()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment