Skip to content

Instantly share code, notes, and snippets.

@jeffhunt
Created March 20, 2014 08:55
__author__ = 'jhunt'
a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
b = [number for number in a if number % 2 == 0]
print(b)
@Raj39120
Copy link

a = list(input("Enter a list of numbers here (in the format of x, y, z): "))
my_list = []
for b in a:
if float(b / 2.0) == b // 2.0:
my_list.append(b)
if float(b / 2.0) != b // 2.0:
pass
print(my_list)

another solution (more user based)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment