Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python odds
numbers = [12, 37, 5, 42, 8, 3]
even = []
odds = []
for num in numbers:
if num % 2: # non-zero result
odds.append(num)
continue
even.append(num)
print even
print odds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment