Files
30-seconds-of-code/snippets/is_upper_case.md
Angelos Chalaris 34df36a961 Update some snippets
2019-08-20 10:51:05 +03:00

357 B

title, tags
title tags
is_upper_case string,utility,beginner

Checks if a string is upper case.

Convert the given string to upper case, using str.upper() and compare it to the original.

def is_upper_case(string):
  return string == string.upper()
is_upper_case('ABC') # True
is_upper_case('a3@$') # False
is_upper_case('aB4') # False