title: Python - how to count an index of a list continuously without using libraries?
body: <p>Below I have a List of the lowercase alphabet. My task is to get the index of a lowercase letter from the list and add the shift. The shift can vary and be other than 1000. It could also be 50000 or 10 etc. If the index + shift is larger than 25, it should continue counting from &quot;a&quot; until (index + shift) has been reached and return the letter. I am not allowed to use libraries.</p>
  <p>My solution doesn't work for big shifts like 1000</p>
  <pre class="lang-py prettyprint-override"><code>shift = 1000
  alphaList = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  
  index = alphaList.index('u')
  index = (index + shift) - len(alphaList)   # this part has to be adjusted 
  print(index)
  print(alphaList[index])
  </code></pre>
  <p>Result should be: 'g'</p>
  <p>what I get is:</p>
  <pre><code>---------------------------------------------------------------------------
  IndexError                                Traceback (most recent call last)
  &lt;ipython-input-20-8d37e597ee25&gt; in &lt;module&gt;
        5 index = (index + shift) - len(alphaList)
        6 print(index)
  ----&gt; 7 print(alphaList[index])
  
  IndexError: list index out of range
  ----------------------------------------------------------------------------
  </code></pre>