Question: another one with the coding stuff... 2. Implement a function digraphs() that takes no parameters. It prompts the user for a string, then counts all

 another one with the coding stuff... 2. Implement a function digraphs()

another one with the coding stuff...

2. Implement a function digraphs() that takes no parameters. It prompts the user for a string, then counts all of the digraphs appearing in the string, and prints a message with the count for each one. A digraph is a 2 letter combination that represents a single sound. For the purposes of this exercise, just count ch, sh, th, and wh. Make sure that digraphs appearing in both upper and lowercase are counted. The following shows several examples of how the function would be used: >>> digraphs () Enter a sentence to scan: This is my shiny sentence. Who cares? Has O'ch', i 'sh', i 'th', and 1 'wh'. >>> digraphs () Enter a sentence to scan: This then is the end Has o 'ch', o'sh,' 3 'th', and 0 'wh'. >>> digraphs() Enter a sentence to scan: one way is not like two way Has O'ch'o'sh'o'th'o'wh' Note: this exercise does not have a doctest because input() doesn't seem to work very well with doctest. You have to do all test design for this problem, on your own

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!