title: connection between for loop index and slice index in python 3
body: <p>This post started as a question but in the meantime I've figured a solution for my problem. So now I would like to know how good ist it and if there is any better / more pythonic way to do it.</p>
  <p>I am a newbie here and with python as well, any suggestions would be greatly appreciated!</p>
  <p>The problem:</p>
  <p>My aim was to count how many times a defined under-string: orange is to be found in a string:</p>
  <pre><code>string = &quot;orangebananaorangeorangebanana&quot;
  counter = 0
  for i in range(len(string)):
      if s[i:i+7] == &quot;orange&quot;
          counter = counter + 1
  print(f&quot;Orange is found {counter} times.&quot;)
  </code></pre>