title: I'm trying to create a bad character filter in Python 3
body: <p>I'm trying to set up a filter that will print out an "Bad Input" message when any character other than A, C, E, T, O, or P is entered. For some reason, I can't wrap my head around what I need to do to make sure that the findLetter() function will actually happen when a GOOD input is entered. Can anyone help me out in what I'm doing wrong in the filter()?</p>
  
  <pre><code>reset = True;
  while ( reset == True ):
  
  #A C E T O P
      def letterA():
          print('   *   ');
          print('  * *  ');
          print(' ***** ');   
          print('*     *');
          print('       ');   
      def letterC():
          print('*****');
          print('*    ');
          print('*    ');
          print('*    ');
          print('*****'); 
          print('     '); 
      def letterE():
          print('****');
          print('*   ');
          print('*** ');
          print('*   ');
          print('****');
          print('    ');  
      def letterT():
          print('*****');
          print('  *  ');
          print('  *  ');
          print('  *  '); 
          print('     '); 
      def letterO():
          print('*****');
          print('*   *');
          print('*   *');
          print('*****'); 
          print('     '); 
      def letterP():
          print('*****');
          print('*   *');
          print('*****');
          print('*    ');
          print('*    ');
          print('     '); 
      def findLetter():
          for x in range(len(temp)):
              if ( temp[x] == 'a' or temp[x] == 'A' ):
                  letterA();
              elif ( temp[x] == 'c' or temp[x] == 'C' ):
                  letterC();
              elif ( temp[x] == 'e' or temp[x] == 'E' ):
                  letterE();
              elif ( temp[x] == 'p' or temp[x] == 'P' ):
                  letterP();
              elif ( temp[x] == 'o' or temp[x] == 'O' ):
                  letterO();
              elif ( temp[x] == 't' or temp[x] == 'T' ):
                  letterT();
  
      def filter(y):  
          for x in range( len(y) ): #bad input filter
              while ( ( y[x] != "a" ) and ( y[x] != "c" ) and ( y[x] != "e" ) and ( y[x] != "p" ) and ( y[x] != "o" ) and ( y[x] != "t" ) and ( y[x] != "A" ) and ( y[x] != "C" ) and ( y[x] != "E" ) and ( y[x] != "P" ) and ( y[x] != "O" ) and ( y[x] != "T" ) ):
                  if ( ( y[x] != "a" ) and ( y[x] != "c" ) and ( y[x] != "e" ) and ( y[x] != "p" ) and ( y[x] != "o" ) and ( y[x] != "t" ) and ( y[x] != "A" ) and ( y[x] != "C" ) and ( y[x] != "E" ) and ( y[x] != "P" ) and ( y[x] != "O" ) and ( y[x] != "T" ) ):
                      y = input( 'Please enter a valid input: A, C, E, P, O, T : ' );
                      userInput = y;
                      temp = y;
  
      userInput = input('Please input any word using any of the following 6 letters: A, C, E, P, O, T : ');           
      temp = userInput;   
      filter(userInput);      
      findLetter();
  
      repeat = input('Would you like to spell more words? (y/n): ');
      while ( repeat != 'y' and repeat != 'n' ):
          repeat = input('Would you like to spell more words? (y/n): ');      
      if ( repeat == 'n' ):
          reset = False;
  </code></pre>