About 213,000 results
Open links in new tab
  1. loops - Python username and password with 3 attempts - Stack Overflow

    Nov 9, 2017 · user = 'Mike' pw = '1234' print('Please enter your username and password: ') username = "" password = "" count = 0 while username != user and password != pw and count < 3: username = input('Username: ') password = input('password: ') if username == user and password == pw: print('Welcome',username) else: print('Denied, Please try again') count ...

  2. python - how to create a while loop for my password - Stack Overflow

    Password2= input("re-enter your password to confirm: ") if Password != Password2: print("the passwords do not match") i want to create a while loop that will make the user keep entering a password until both Password and Password2 match. Any help will be appreciated.

  3. While Loop Password Example - Cave of Python

    Here's a program that asks for a password and loops repeatedly until you enter the correct password. PASSWORD = "hello" while True: password = input("Enter your password: ") if password == PASSWORD: break else: print("Password incorrect") print("Password correct.")

  4. python - if statement in while loop for password checker - Stack Overflow

    Jun 17, 2021 · while len(str(password)) < MIN_PASSWORD_LENGTH and len(str(password)) > MAX_PASSWORD_LENGTH: if password.isalpha(): message = "password weak – contains only letters" elif password.isnumeric(): message = "password weak – contains only numbers" else: message = "password strong" break print(message)

  5. Password validation in Python - GeeksforGeeks

    Dec 30, 2022 · It uses a single for loop to iterate through the characters in the password string, and checks if the password contains at least one digit, one uppercase letter, one lowercase letter, and one special symbol from a predefined list and based on ascii values.

  6. Username and Password inputs with 3 attempts in Python

    Apr 9, 2024 · To take username and password input values with 3 attempts: Use a while loop to iterate a maximum of 3 times. Use the input() function to take values for the username and password from the user. If the credentials are correct, break out of the loop. username = input('Enter your username: ') .

  7. How To Construct While Loops in Python 3 - DigitalOcean

    Aug 20, 2021 · In this program, we’ll ask for the user to input a password. While going through this loop, there are two possible outcomes: If the password is correct, the while loop will exit. If the password is not correct, the while loop will continue to execute.

  8. Python Program to Check Password Validation

    In this tutorial, we are going to discuss how to use Python while loop to check that the password is valid or not. So, we will be asking the user to enter a password and validate it using a while loop.

  9. Password Generator (using while loops) - Trinket

    Python in the browser. No installation required.

  10. Python username and password program - Code Review Stack …

    May 28, 2017 · # Python 3.4.3. Using MacOS (Version 10.12.5) # Username and Password... # The programs purpose: A user must enter the correct username and password for a site called FaceSnap... # The correct username is elmo and the correct password is blue. userName = …

  11. Some results have been removed