Created
November 2, 2016 18:14
-
-
Save markuz/1587bf94967015ff8bd1942a31d7df86 to your computer and use it in GitHub Desktop.
Python odds
This file contains hidden or 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
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