title: Python - Rotations of digits
body: <p>I'm trying to create code that will take a given integer, then output a set of integers, all of which are rotations of digits of the input integer.</p>
  
  <p>Thus, if I inputted '197', the output should be '197', '971', and '791'.</p>
  
  <p>However, when I try:</p>
  
  <pre><code>def rotation(n):
    rotations = set()
    for i in range( len( str(n) ) ):
      n = int( str(n)[i:] + str(n)[:i] )
      rotations.add(n)
  </code></pre>
  
  <p>with the input '197', it only returns '197', '971', yet NOT '791'.</p>
  
  <p>Why is this happening?</p>