Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for All Upper I by ezebw2
import re
def is_all_upper(text: str) -> bool:
"""
Returns True if text has no letters, or has all symbols in upper case,
returns False otherwise
For the purposes of this exercise, the condition of empty string and a string with no letters are equivalent,
and are evaluated with the same comparison.
"""
if re.search('[a-zA-Z]', text) == None:
return True
if text.upper() == text:
return True
return False
Aug. 5, 2020
Comments: