Skip to content

Instantly share code, notes, and snippets.

@irenecasado
Created January 12, 2022 03:09
Show Gist options
  • Select an option

  • Save irenecasado/ac16e798e74c7b5c5d762ecddd32dbaf to your computer and use it in GitHub Desktop.

Select an option

Save irenecasado/ac16e798e74c7b5c5d762ecddd32dbaf to your computer and use it in GitHub Desktop.
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