From 6887cce5ead581d9beba6e4992b227dd1a71c649 Mon Sep 17 00:00:00 2001 From: geek1834 <44375459+geek1834@users.noreply.github.com> Date: Mon, 22 Oct 2018 23:33:10 +0530 Subject: [PATCH] comparelist.py --- SOLUTIONS/comparelist1.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 SOLUTIONS/comparelist1.py diff --git a/SOLUTIONS/comparelist1.py b/SOLUTIONS/comparelist1.py new file mode 100644 index 00000000..adc2cd2f --- /dev/null +++ b/SOLUTIONS/comparelist1.py @@ -0,0 +1,9 @@ +a = [1, 2, 3, 4, 5] +b = [9, 8, 7, 6, 5] + +lista =set(a) +listb =set(b) +print listb.intersection(lista) +returnMatches = set(['5']) #output + +print " ".join(str(return) for return in returnMatches )