Check if a String Contains only Identical Characters

Published by Helen Yu in

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

Watch a quick demo on how Edabit works.