title: implement my own strip method in Python
body: <p>I am trying to implement my own strip method in Python, so without using the built-in method, I'd like my function to strip out all the whitespace from the left and the right.</p>
  
  <p>Here, what I am trying to do is create a list, remove all the blank character before the first non-space character, then do it reverse way, finally return the list to a string. But with what I wrote, it doesn't even remove one whitespace.</p>
  
  <p>I know what I am trying to do might not even work, so I would also like to see the best way to do this. I am really new to programming, so I would take any piece of advise that makes my program better. Thanks!</p>
  
  <pre><code># main function
  inputString = input("Enter here: ")
  print(my_strip(inputString))
  
  def my_strip(inputString):
      newString = []
      for ch in inputString:
          newString.append(ch)
      print(newString)
      i = 0
      while i &lt; len(newString):
          if i == " ":
              del newString[i]
          elif i != " ":
              return newString
          i += 1
      print(newString)
  </code></pre>