Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Caps Lock by arun_maiti
def caps_lock(text: str) -> str:
return "".join((v, v.upper())[i % 2] for i, v in enumerate(text.split("a")))
print("Example:")
print(caps_lock("Why are you asking me that?"))
# These "asserts" are used for self-checking
assert caps_lock("Why are you asking me that?") == "Why RE YOU sking me thT?"
assert caps_lock("Always wanted to visit Zambia.") == "AlwYS Wnted to visit ZMBI."
assert caps_lock("Aloha from Hawaii") == "Aloh FROM HwII"
print("The mission is done! Click 'Check Solution' to earn rewards!")
Dec. 5, 2025
Comments: