Created
May 9, 2018 15:23
-
-
Save niklatkin/2a77570571419b2d7e9bde74f2186c24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = 'azcbobobegghakl' | |
l = 0 | |
count = 0 | |
x = len(s) | |
for i in s: | |
if i == "b" and l+1 < x and l+2 <x: | |
if (s[l+1] == "o" and s[l+2]=="b"): | |
count = count + 1 | |
l = l + 1 | |
print("Number of times bob occurs is: "+str(count)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment