Question: Derive a Python function named count that will calculate the number of occurrences of character c in a chain s. try 2 versions: with the

Derive a Python function named count that will calculate the number of occurrences of character c in a chain s. try 2 versions: with the method count of the str class and without that it (use a loop while or for).

Develop the main part of the program that get from the user a character chain named s, and call the function twice to calculate the number of a and of 'de la'. The last part should be:

print(count(s,'a'))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!