Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = "bob bob bob bob bob"
- str = s
- sub = "bob"
- print ("Number of times bob occurs is: ", str.count(sub, 0, len(s)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement