title: trim() function in Python using Flask
body: <p>Is there a function like trim() in python?</p>
  
  <p>i use Flask miniframework and it doesn't accept:</p>
  
  <p><code>selected_student = (request.args.get('student_form')).strip()</code></p>
  
  <p>its error:    <code>AttributeError: 'NoneType' object has no attribute 'strip'</code></p>
  
  <hr>
  
  <p><code>selected_student.replace(" ", "")</code> </p>
  
  <p>its error:     <code>AttributeError: 'NoneType' object has no attribute 'replace'</code></p>
  
  <hr>
  
  <p>i need a function like trim() without coding a class/subclass or  javascript</p>