Created
November 30, 2016 23:02
-
-
Save gtokman/9b11a3e3b1b30290ce90fe30ff5393b5 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
# Given a String | |
example_string = "Hello Welcome to New York City" | |
def find_capitals(words): | |
capitals = list() | |
for letter in list(words): | |
# Determine the letters that are capital case | |
if letter.isupper(): | |
# put them into an array | |
capitals.append(letter) | |
# order alpha | |
capitals.sort() | |
return capitals | |
capitals = find_capitals(example_string) | |
print(capitals) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment