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.
I am a newbie here and with python as well, any suggestions would be greatly appreciated!
The problem:
My aim was to count how many times a defined under-string: orange is to be found in a string:
string = "orangebananaorangeorangebanana"
counter = 0
for i in range(len(string)):
if s[i:i+7] == "orange"
counter = counter + 1
print(f"Orange is found {counter} times.")