Created
March 16, 2023 14:33
-
-
Save ae5259/eee1743f69d4fa53bef5a4f5c3ab44ea to your computer and use it in GitHub Desktop.
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
nums = list(range(20)) | |
evens = [num for num in nums if num%2==0] | |
odds = [num for num in nums if num%2!=0] | |
print(evens) | |
print(odds) | |
print(sum(evens)) | |
print(sum(odds)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment