title: Cut m and n letters from end of string, then find number of turns to get back original string
body: <p>Question: Given are a string and m and n.</p>
  
  <p>input 1: original string</p>
  
  <p>input 2: m (less than length of string): cut m alphabets from end of string and then add to begining of string. </p>
  
  <p>input 3: n (less than length of string) : cut n alphabets from end of string obtained from above step and then add to begining of that string.</p>
  
  <p>This process is continued, need to find out the number turns it takes to get back original string.</p>
  
  <pre class="lang-py prettyprint-override"><code>def harry(str, m, n):
      le = len(str)
      org = str.upper()
      str = str.upper()
      turn = 0
      for i in str:
          str3 = str[-m:] # last n letters
          str = str.replace(' ', '')[:-m]
          str = str3 + str
          print(str)
          if org != str:
              turn = turn + 1
              str4 = str[-n:]
              str = str.replace(' ', '')[:-n]
              str= str4 + str
              print(str)
              turn = turn + 1
          if org == str:
              break
      print(turn)
  
  str = input("Enter the string")
  m=int(input("Enter the value of m"))
  n=int(input("Enter the value of n"))
  harry(str, m, n)
  </code></pre>
  
  <p>output obtained:</p>
  
  <pre><code>Enter the stringarya
  Enter the value of m1
  Enter the value of n2
  AARY
  RYAA
  ARYA
  2
  </code></pre>
  
  <p>original output to be obtained: </p>
  
  <pre><code>3 
  </code></pre>
  
  <p>(It takes 3 turns to get back original string Arya.)</p>
  
  <p>I am getting output for all words except words like this, especially when same letter occurs consecutively.
  Please help me out with this.</p>