id/email
password
forgot password
about | help | done | prefs | create account
CodingBat code practice

Python > String-2 > count_hi
prev  |  next  |  chance

Return the number of times that the string "hi" appears anywhere in the given string.

count_hi('abc hi ho') → 1
count_hi('ABChi hi') → 2
count_hi('hihi') → 2

...Save, Compile, Run         

See also Python Example Code. Python help docs: Python Strings | Python Lists | Python If Boolean


prev  |  next  |  chance   |  CodingBat  >  String-2

Forget It! -- delete my code for this problem 206.0

Copyright Nick Parlante 2006-10 - privacy