Nov-27-2017, 08:12 AM
@wavic
using
using
if not any
is wrong and would yield the opposite resultname = 'test' inappropriate = "<>#!@$%^&*()_- {}" if not any(map(lambda char: char in inappropriate, name)): print('invalid')
Output:invalid
and there is no need to complicate it with using lambda, keep it simpleinappropriate = "<>#!@$%^&*()_- {}" if any(char in inappropriate for char in name): # The name is not alright.