Password Validation in Python
You shouldn't use bare excepts, this is as it can prevent things like KeyboardInterrupt.
That's just bad.
password is a better variable name than pw, at first I was quite confused about what it was.
You can return early if you know the password is not valid.
This can save you a lot of checks in your program.
Your program goes through each character and checks if it's one of the four valid groups.
Instead you can check if it shares any items with that set.
If it doesn't it's not valid.
You're creating warnings un-neededly, currently, excluding the cast, the functionality is the same if it's a list.
Instead of a warning you should either raise an error, or return.

This is as if I pass ['P', 'a', '$', '2', 1, 2] it probably shouldn't return True, which it might on a different implementation.
Instead you can either hard limit your input to strings, or check if the contents of the input are strings. Or both.


In short, just change password to a set, and use &amp; with the groups it needs to be a part of.
This can remove the need to make the function check_number, and makes the code much more readable:

import string

def check_validity(password):
    ''' Return True if input pw is valid, and return False if invalid.'''
    if isinstance(password, str) \
            or not all(isinstance(c, str) for c in password):
        return False

    if len(password) &lt; 6:
        return False

    password = set(password)
    checks = [
        set(string.ascii_lowercase),
        set(string.ascii_uppercase),
        set(string.digits),
        {'$', '#', '@'},
    ]

    for check in checks:
        if not check &amp; password:
            return False
    return True

print check_validity('P@ss1234')