Created
March 20, 2014 08:55
This file contains 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
__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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)