Question: What is the following program doing given that the user inputs one character into variable a ______________? (assume correct indentation) s = input() a =
What is the following program doing given that the user inputs one character into variable a______________? (assume correct indentation)
s = input()
a = input()
c = 0
for i in range(len(s)):
if a == s[i]:
c = c + 1
print (c)
| computing the sum of numbers | ||
| searching for the letter c in a sentence | ||
| it will not do anything because it has syntax errors | ||
| counting how many times a character occurs in string s |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
