id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

For Loopsfor_loop4

prev  |  next  |  chance
def for_loop4(str, x):
    result = 0
    for i in str:
        if i == x:
            result += 1
    return result
Function Call  Return Value
for_loop4('athenian', 'e')
for_loop4('apples', 'a')
for_loop4('hello', 'a')
for_loop4('alphabet', 'h')
for_loop4('aaaaa', 'b')

Experiment with this code on Gitpod.io

⬅ Back