Cuéntanos qué está pasando:
I’m not understanding why it doesn’t pass the test, if it asks me for the first element lowercase, and for the second ‘[a-z]’, can someone help me get out of here?
Tu código hasta el momento
import re
import secrets
import string
def generate_password(length, nums, special_chars, uppercase, lowercase):
# Define the possible characters for the password
letters = string.ascii_letters
digits = string.digits
symbols = string.punctuation
# Combine all characters
all_characters = letters + digits + symbols
while True:
password = ''
# Generate password
for _ in range(length):
password += secrets.choice(all_characters)
# User Editable Region
constraints = [
(nums, '[0-9]'),
(lower(), '[a-z]')
]
# User Editable Region
return password
# new_password = generate_password(8)
# print(new_password)
pattern = '[^a-z]t'
quote = 'Not all those who wander are lost.'
# print(re.findall(pattern, quote))
Información de tu navegador:
El agente de usuario es: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Información del Desafío:
Aprende Expresiones Regulares para Construir un Generador de Contraseñas - Paso 39