Question: Write a function called count _ hyphens that requires no parameters performs the following algorithm: Ask the user for a string using the console (
Write a function called counthyphens that requires no parameters performs the following algorithm:
Ask the user for a string using the console terminal
Required prompt: 'Please enter a string:
Count the number of hyphens in the string
a hypen is this
Return an integer that is the number of hyphens in the string
printing to the console is not the same thing as returning a value even though it looks that way in the output examples
def counthyphens int:
# YOUR IMPLEMENTATION
Examples of the function running should appear as follows:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
