vendredi 21 février 2020

Why does my code repeat itself (if-statement) [closed]

I'm trying to make a User/Password list, that has the function to add new Users with Passwords. But when I run the code, it never stops asking me for Usernames and Passwords, even though I dont want it to.

If you can help me figure out the problem, that would be great. And If you can help me make the code easier and more efficient for example, that would be even better! Thanks in advance.


def newUser():
  passList.append([input("Enter a Username: "), input("Enter a Password: ")])
  if input("Do you want to add another User? (Y/N):  ") == "Y":
    newUser()
  else:
    print(passList)

newUser()


Aucun commentaire:

Enregistrer un commentaire