Help me in solving PYTH99A problem

My issue

My code

# Count how many 'o's are present in the string using a 'for' loop and 'if' condition

string = 'Bolloon'

# use this variable to count occurrences of o
count_o = 0
for i in string:
    if i == 'o':
        # iterate through the string, everthing you find an 'o', increase count_o by 1
        count_o = count_o + 1 
        
        print(count_o)
        
        

Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone

@nabhinaya
Two mistakes u haven’t declare the string and u have to print the count_o outside the loop u u have to take care of the indentation.
i have corrected your code.

Count how many 'o’s are present in the string using a ‘for’ loop and ‘if’ condition

string = ‘bolloon’

use this variable to count occurrences of o

count_o = 0
for i in string:
if i == ‘o’:
# iterate through the string, everthing you find an ‘o’, increase count_o by 1
count_o = count_o + 1

print(count_o)