swap letters in a string in python
<p>I am trying to switch the first character in a string and move it to the end of the string. It needs to repeat the rotation a number of n times.
For example, <code>rotateLeft(hello,2)=llohe</code>.</p>

<p>I tried doing</p>

<pre><code>def rotateLeft(str,n):
    rotated=""
    rotated=str[n:]+str[:n]
    return rotated 
</code></pre>

<p>Is this right, and how would you do it if it remove the last character and move it to the front of the string?  </p>
