Last active
January 23, 2023 21:21
-
-
Save zhongleqi/8779687391320bf5534386b9f6a043f0 to your computer and use it in GitHub Desktop.
Leqi Zhong, Programming in Journalism, Assignment 1. Jan. 23, 2023
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
animals = ['cat', 'dog', 'canary', 'chihuahua', 'narwhal'] | |
filtered_animals = [] | |
number = 0 | |
for animal in animals: | |
if (animal[0]) == "c": | |
filtered_animals.append(animal.upper()) | |
number = number + 1 | |
print(filtered_animals, "Number of C-animals: ", number) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment