title: Search character in String
body: <p>I am trying to write a function to search for a character within a string. Given a character and string as inputs, the function should return the index of the first occurrence of the character within the string. If the string does not contain the character, the function should return -1.</p>
  
  <p>I am not allowed to use any built-in library functions to answer this question (e.g. not use the find() or index() functions).</p>
  
  <p>I have attempted to answer this with the following code:</p>
  
  <pre><code>string = list(input("Enter string/text you would like to use: "))
  search = input("Enter character you would like to search: ")
  
  # Main loop that searches for character in string
  while True:
      index = -1
      for char in string:
          index = index + 1
          if char == search:
              print(True)
              print(index)
              break
  </code></pre>
  
  <p>However, when running, although using a break, it is caught in a loop. Any suggestions as to how to solve this question?</p>