Created
January 12, 2022 03:09
-
-
Save irenecasado/ac16e798e74c7b5c5d762ecddd32dbaf 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
| animals = ['cat', 'dog', 'canary', 'chihuahua', 'narwhal'] | |
| filtered_animals = [] | |
| for animal in animals: | |
| if animal.startswith('c'): | |
| print(animal.upper()) | |
| filtered_animals.append(animal) | |
| print('Number of C-animals: '+str(len(filtered_animals))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment