inappropriate = "<>#!@$%^&*()_- {}" if not any(map(lambda char: char in inappropriate, name)): # The name is not alright.
the map function is mapping the lambda function with any character in the name. This will produce a list of the results of the lambda function. And any() returns True if there is not any value in the list which could be considered False - None, 0, False, empty value.