title: Return value if string has x character
body: <p>The program asked is:</p>
  
  <p>"besides testing if the length of the given string is more than ten characters, it also tests if there is the character "X" (capital X) in the given string. If the string is longer than 10 characters and it has X in it, the tester subfunction returns a value True to the main function, otherwise False.</p>
  
  <p>If the subfunction returns True to the main function, the program prints "X spotted!". As earlier, if the user inputs "quit", the program terminates."</p>
  
  <p>This is what I tried, but the part of checking the x character does not work at all</p>
  
  <pre class="lang-py prettyprint-override"><code>def check(st,res="Too short"):
      if len(st)&gt;=10:
          if checkX(st):
              st=st+"\nX spotted!"
          return st
      else:
          return res
  
  def checkX(st):
      for i in st:
          if i=="X":
              return True
      return False
  
  def main():
      while True:
          st=input("Write something (quit ends): ")
          if st=="quit":
              break
          print(check(st))
  </code></pre>
  
  <p>It only checks if introduced string length is equal or higher than 10 characters.</p>