Created
November 5, 2016 07:41
-
-
Save Wingless-Archangel/eb14b913810962a1b9070ae1adf83236 to your computer and use it in GitHub Desktop.
return the list of element that exists in 2 list
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
#!/usr/bin/python3 | |
def main(): | |
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | |
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] | |
ans = list(set([num for num in a if num in a and num in b])) | |
print(ans) | |
if __name__ =='__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment