From e9d030e5fd8fa107797fac1489bca6ce2724d212 Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Mon, 10 Feb 2025 20:39:47 +0000 Subject: - Added solutions by Eric Cheung. - Added solutions by Ulrich Rieke. - Added solutions by Mark Anderson. - Added solutions by David Ferrone. - Added solutions by Ali Moradi. - Added solutions by Niels van Dijke. - Added solutions by Peter Pentchev. - Added solutions by E. Choroba. - Added solutions by Peter Meszaros. - Added solutions by Thomas Kohler. - Added solutions by W. Luis Mochan. - Added solutions by BarrOff. --- challenge-308/eric-cheung/python/ch-1.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 challenge-308/eric-cheung/python/ch-1.py (limited to 'challenge-308/eric-cheung/python/ch-1.py') diff --git a/challenge-308/eric-cheung/python/ch-1.py b/challenge-308/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..e05d16d0b8 --- /dev/null +++ b/challenge-308/eric-cheung/python/ch-1.py @@ -0,0 +1,16 @@ + +## Example 1 +## arrStr_01 = ["perl", "weekly", "challenge"] +## arrStr_02 = ["raku", "weekly", "challenge"] + +## Example 2 +## arrStr_01 = ["perl", "raku", "python"] +## arrStr_02 = ["python", "java"] + +## Example 3 +arrStr_01 = ["guest", "contribution"] +arrStr_02 = ["fun", "weekly", "challenge"] + +arrCommon = [strLoop for strLoop in arrStr_01 if strLoop in arrStr_02] + +print (len(arrCommon)) -- cgit