wrong = '@&*$/' password=input("enter your password") for i in password: if i in wrong: print('Запрещенный символ -',i)