Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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() 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 ownStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started