logo CodeStepByStep logo

contains_twice

Language/Type: Python boolean string return

Write a function named contains_twice that accepts a string and a character as parameters and returns True if that character occurs two or more times in the string. For example, the call of contains_twice("hello", 'l') should return True because there are two 'l' characters in that string.

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.