Learn Regular Expressions by Building a Password Generator - Step 57

I don’t know what I need to do with this. I have tried what feels like everything and I can’t move past it

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)
       
        constraints = [
            (nums, r'\d'),
            (lowercase, r'[a-z]'),
            (uppercase, r'[A-Z]'),            
            (special_chars, fr'[{symbols}]')            
        ]

# User Editable Region

        # Check constraints
        for constraint, pattern in constraints:
            if len(re.findall(pattern, password)) <= constraint:
                pass
            else:
                pass

# User Editable Region

    return password

# new_password = generate_password(8)
# print(new_password)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15

Challenge Information:

Learn Regular Expressions by Building a Password Generator - Step 57

Do the comparison only, don’t make an if/else out of it

It’s a bit non-intuitive, because it’s not correct syntax, it’s just the first step

What are the instructions for this step? Look carefully at the wording

need to modify on the same line of code. not required any new line