Code: Alles auswählen
import csv
PASSWORD_FILENAME = "/storage/emulated/0/passw.csv"
def main():
answer = input("Do you have an account?(yes or no) ")
if answer != 'yes':
print('Only with password.')
return
with open(PASSWORD_FILENAME, encoding='utf8') as csvfile:
reader = csv.reader(csvfile, delimiter=';')
passwords = next(reader)
for heading in ['password: ', '2 more attempts: ', 'last attempt: ']:
password = input(heading)
if password in passwords:
break
else:
print("3 times incorrect password.")
return
print("You are now logged in!")
if __name__ == '__main__':
main()