title: Python - Input from user is not recognized as "Y" or "N"
body: <p>I'm trying to write a simple program to get myself back into python after a long break caused by my personal life. The purpose of the program is to do as follows:</p>
  
  <ul>
  <li>Ask the user to enter a number equal to 5 (very simple, I know)</li>
  <li>Check if what the user inputs is valid</li>
  <li>Check if the user's input is equal to 5</li>
  <li>Ask the user if they would like to run the program again</li>
  <li>Run the program if the user inputs <code>y</code> or <code>Y</code>, and exit the program if the input is <code>n</code> or <code>N</code></li>
  </ul>
  
  <p>import os</p>
  
  <pre><code>askme = raw_input("Enter a number that is equal to 5: ")
  
  def check_att(attrib):
      if int(attrib) == 5:
          os.system("cls")
          print "Yes, %s is equal to 5! Good job!" % attrib
          again = raw_input("Would you like to try again? (Y/N): ")
          print again
          if again == again.isalpha():
              if again == "y" or "Y":
                  os.system("cls")
                  print attrib
                  print check_att(attrib)
              elif again == "n" or "N":
                  os.system("exit")
          else:
              os.system("cls")
              not_alpha1 = raw_input("Sorry, that's not a valid answer. Would you like to try again? (Y/N): ")
              print not_alpha1
              if not_alpha1 == "y" or "Y":
                  os.system("cls")
                  print attrib
                  print check_att(attrib)
              elif not_alpha1 == "n" or "N":
                  os.system("cls")
      else:
          sorry = raw_input("Sorry, %s is not equal to 5. Try again? (Y/N): " % attrib)
          print sorry
          if sorry == sorry.isalpha():
              if sorry == "y" or "Y":
                  os.system("cls")
                  print attrib
                  print check_att(attrib)
              elif sorry == "n" or "N":
                  os.system("exit")
          else:
              os.system("cls")
              not_alpha = raw_input("Sorry, that's not a valid answer. Would you like to try again? (Y/N): ")
              print not_alpha
              if not_alpha == "y" or "Y":
                  os.system("cls")
                  print attrib
                  print check_att(attrib)
              elif not_alpha == "n" or "N":
                  os.system("cls")
  
  print askme
  print check_att(askme)
  </code></pre>
  
  <p>The problem I'm having is the part where the program asks the user if they want to run the program again. This is what happens when I run the code:</p>
  
  <pre><code>Enter a number that is equal to 5: 5
  5
  Yes, 5 is equal to 5! Good job!
  Would you like to try again? (Y/N): Y
  Y
  Sorry, that's not a valid answer. Would you like to try again? (Y/N): 
  </code></pre>
  
  <p>I don't know how to get the program to recognize <code>Y</code> as a valid input. Any help is greatly appreciated.</p>