← Back to challenges

Check if a String Contains only Identical Characters

PythonHardstringsvalidation

Instructions

Write a function that returns True if all characters in a string are identical and False otherwise.

Examples

is_identical("aaaaaa") ➞ True

is_identical("aabaaa") ➞ False

is_identical("ccccca") ➞ False

is_identical("kk") ➞ True

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Check if Number is within a Given Range