Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Correct Capital by freixodachamorra
import re
def correct_capital(line: str) -> bool:
pattern = re.compile(r'^[A-Z][a-z]*$|^[A-Z]+$|^[a-z]+$')
if pattern.match(line) == None:
return False
else:
return True
print("Example:")
print(correct_capital("Checkio"))
assert correct_capital("Checkio") == True
assert correct_capital("CheCkio") == False
assert correct_capital("CHECKIO") == True
print("The mission is done! Click 'Check Solution' to earn rewards!")
Nov. 25, 2022
Comments: