title: Can't get online parser to accept solution in Udemy Python Course
body: <p>I'm part-way through an online Udemy course for learning Python and am stuck at one of the online exercises. The course uses Jupyter Notebook but every now and then it asks you to enter some code directly into the browser (exercise.py maybe?). I have a solution to one of the problems that seems to work okay in Jupyter Notebook but I can't get the online version to work (the Udemy website where you enter the code and it checks to see if performs the requested function).</p>
  <p>The problem to solve is: define a function called <code>myfunc</code> that takes a string and returns a matching string but where the case of each letter is inverted, i,e, all uppercase to be lowercase, all lowercase to be uppercase. So for example &quot;Banana&quot; would return &quot;bANANA&quot;. The website states not to worry about spaces or numbers but that the function has to return a string and not just print out the result.</p>
  <p>This is my solution, which appears to work okay in the notebook:</p>
  <pre class="lang-py prettyprint-override"><code>def myfunc(word):
          
      mystr=&quot;&quot;
          
      for letter in word:
          if letter.isupper():
              mystr=mystr+letter.lower()
          else:
              mystr=mystr+letter.upper()
      
      return mystr
  </code></pre>
  <p>However, I can't get the online version to accept this and it just keeps coming back with:</p>
  <p>&quot;Oops your solution is incorrect. False is not true.&quot;</p>
  <p>Can anyone see what's wrong with the way I've done it? Is the online course expecting a different approach? I was thinking that although my solution seems to work, maybe I've gone about it in an unconventional way and that's what's causing the problem?</p>