Skip to content

Instantly share code, notes, and snippets.

@Tanver-Hasan
Last active September 18, 2018 23:19
Show Gist options
  • Save Tanver-Hasan/f6fed4b3174ff15e23f3f9e61c8c04b0 to your computer and use it in GitHub Desktop.
Save Tanver-Hasan/f6fed4b3174ff15e23f3f9e61c8c04b0 to your computer and use it in GitHub Desktop.
#Find character secuences including overlapping matches
s = "azcbobobegghakl"
p=[i for i in range(len(s)) if s.startswith('bob', i)]
print(p);
print(len(p))
# Reading list
#Recommend Reading
# https://docs.python.org/3/tutorial/datastructures.html
# https://medium.freecodecamp.org/python-list-comprehensions-vs-generator-expressions-cef70ccb49db
# https://docs.python.org/3/howto/functional.html
#Advnaced Reading
# https://markheath.net/post/python-list-comprehensions-and
#https://docs.python.org/3.7/whatsnew/2.0.html#list-comprehensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment