Python 5 Minute Mini Project - Beginners Basic Password Login 2022

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 6

  • @Akranza-graphix
    @Akranza-graphix 4 місяці тому +2

    Thank you Dr. These mini programs will surely improve my creativity and practice

    • @DrPythonCode
      @DrPythonCode  4 місяці тому

      You're welcome it's all good practice.

  • @ChaRambo
    @ChaRambo 9 місяців тому +3

    Nice. I rewrote it with a while loop so if you get your password wrong it refreshes the input
    user = "charles"
    password = "admin123"
    def login():
    print("Enter User & Password")
    def logged_in():
    print("You are Logged in")
    quit()
    while True:
    entry1 = input("User Name: ")
    entry2 = input("Password: ")
    if entry1 == user and entry2 == password:
    print("Login Successful")
    logged_in()
    else:
    print("Login Failed")

    • @DrPythonCode
      @DrPythonCode  9 місяців тому +1

      Great stuff the while loop is handy the other way for me is a time saver.

  • @UnbackedMuffn
    @UnbackedMuffn 10 місяців тому +1

    Would it be better to use a while loop for the login or would it be about the same thing?

    • @DrPythonCode
      @DrPythonCode  9 місяців тому

      Quite possibly but the point with these programs is to explore the language while having a bit of fun with off the peg stuff.