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

 

twostr


you have two strings. the second character is one character. print the number of times the second string shows up in the first.


twostr('hello world', 'o') → 2
twostr('jjjjffffff', 'f') → 6
twostr('codingbat is fun!', 'i') → 2

...Save, Compile, Run (ctrl-enter)

def twostr(str,n):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100

Copyright Nick Parlante 2017 - privacy