Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Validate Strong Passwords | Advanced Regular Expressions and Applications
Python Regular Expressions

bookChallenge: Validate Strong Passwords

To practice applying advanced regular expression techniques, you will create a password validator that checks if a password is strong.

Write a function called is_strong_password(password) that returns True if the password meets all these requirements, and False otherwise. Use regular expressions to perform the necessary checks.

Oppgave

Swipe to start coding

You need to create a function that checks if a password is strong using regular expressions. A strong password must satisfy all of these requirements:

  • Be at least 8 characters in length;
  • Include at least one uppercase letter;
  • Include at least one lowercase letter;
  • Include at least one digit;
  • Include at least one special character (any character that is not a letter or digit).

Return True if the password meets all criteria, or False if it does not.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 5
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Suggested prompts:

What are the specific requirements for a strong password?

Can you provide an example of a strong and a weak password?

Do you want the function to return any error messages, or just True/False?

close

Awesome!

Completion rate improved to 6.67

bookChallenge: Validate Strong Passwords

Sveip for å vise menyen

To practice applying advanced regular expression techniques, you will create a password validator that checks if a password is strong.

Write a function called is_strong_password(password) that returns True if the password meets all these requirements, and False otherwise. Use regular expressions to perform the necessary checks.

Oppgave

Swipe to start coding

You need to create a function that checks if a password is strong using regular expressions. A strong password must satisfy all of these requirements:

  • Be at least 8 characters in length;
  • Include at least one uppercase letter;
  • Include at least one lowercase letter;
  • Include at least one digit;
  • Include at least one special character (any character that is not a letter or digit).

Return True if the password meets all criteria, or False if it does not.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 5
single

single

some-alt