Skip to content

Instantly share code, notes, and snippets.

@adriendumont
Created October 27, 2013 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adriendumont/7186825 to your computer and use it in GitHub Desktop.
Save adriendumont/7186825 to your computer and use it in GitHub Desktop.
# COUNTING VOWELS
c = 0
for i in s:
if (i in ['a', 'e', 'i', 'o', 'u']):
c+=1
print(c)
# COUNTING BOBS
c = 0
for i in range(len(s)-2):
if (s[i]=='b' and s[i+1] == 'o' and s[i+2] == 'b'):
c+=1
print(c)
# ALPHABETICAL SUBSTRINGS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment