Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. def count_hi(str):
  2. count = 0
  3. for i in range(0, len(str)-1):
  4. if str[i] == 'h' and str[(i+1)] == 'i':
  5. count = count + 1
  6. return count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement