Skip to content

Instantly share code, notes, and snippets.

@Just-Simple-59
Last active June 22, 2021 18:11
Show Gist options
  • Save Just-Simple-59/0c088634b3e0cf5eea8e1d371cac87e7 to your computer and use it in GitHub Desktop.
Save Just-Simple-59/0c088634b3e0cf5eea8e1d371cac87e7 to your computer and use it in GitHub Desktop.
Take a list and write a program that prints out all the elements of the list that are less than 5.
a = [1, 1, 2, 3, 5, 8, 4, 3, 13, 21, 34, 55, 89, 4]
b = []
for element in a:
if element < 5:
b.append(element)
print(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment