Created
December 19, 2017 01:35
-
-
Save animatedlew/aaa690ab6ee8f7f52cb23e3e33ab2f4d 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
def get_total_pairs(nums, total): | |
return [(x, y) for y in nums for x in nums if x + y == total] | |
if __name__ == '__main__': | |
print(get_total_pairs([1, 2, 3, 4, 5, 6, 7, 8, 9], 10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment