Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.12 KB | None | 0 0
  1. s = "bob bob bob bob bob"
  2. str = s
  3.  
  4. sub = "bob"
  5. print ("Number of times bob occurs is: ", str.count(sub, 0, len(s)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement