Created
March 2, 2020 18:39
-
-
Save jlewin/32cb5520b9a9d1c92f2f0e3e3df5d2ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def count_upper_words(str): | |
words = str.split(' '); | |
print('\n\n---- %s ----' % str) | |
return sum([word.isupper() for word in words]) | |
print(count_upper_words('Fast')) | |
print(count_upper_words('SLOW')) | |
print(count_upper_words('first MIDDLE Last')) | |
print(count_upper_words('first MIDDLE LAST')) | |
print(count_upper_words('FIRST MIDDLE LAST')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment