Python Programming assignment

computer science

Description

In Python......I need help on this output. Please help me write this string????? I wrote the program but can figure out the output. Normally I just run a module in shell. Here is what I wrote, but can't figure out how to get the count. The exercise is attached in image. 


def main():

s = input("Enter a string: ").strip()
ch = input("Enter a character: ").strip()
print(count(s, ch))
def count(s, ch):
count = 0
for c in s:
if ch == c:
count += 1
return count
main()

Instruction Files

Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.