logo CodeStepByStep logo

print_letters

Language/Type: Python errors fencepost string

Consider the flawed function print_letters that follows, which accepts a string as its parameter and attempts to print the letters of the string, separated by dashes. For example, the call of print_letters("Rabbit") should print R-a-b-b-i-t. The initial code shown is incorrect. Correct it to produce the desired behavior. (Your function should print nothing if the empty string ("") is passed.)

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.