aboutsummaryrefslogtreecommitdiff
path: root/challenge-277/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
author冯昶 <fengchang@novel-supertv.com>2024-07-15 10:23:32 +0800
committer冯昶 <fengchang@novel-supertv.com>2024-07-15 10:23:32 +0800
commit18e08d1c65808d14894933b1a14312403a3fb8d6 (patch)
tree17ec1e2908ef58df77f49577969b3593ea9bfc4e /challenge-277/eric-cheung/python/ch-1.py
parent894abedddc120cf679f3aae060e0dcd6a7325dd1 (diff)
parentf1533357698083086127e85e17fd8e2a80780e76 (diff)
downloadperlweeklychallenge-club-18e08d1c65808d14894933b1a14312403a3fb8d6.tar.gz
perlweeklychallenge-club-18e08d1c65808d14894933b1a14312403a3fb8d6.tar.bz2
perlweeklychallenge-club-18e08d1c65808d14894933b1a14312403a3fb8d6.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'challenge-277/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-277/eric-cheung/python/ch-1.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/challenge-277/eric-cheung/python/ch-1.py b/challenge-277/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..c08ac8a721
--- /dev/null
+++ b/challenge-277/eric-cheung/python/ch-1.py
@@ -0,0 +1,16 @@
+
+## Example 1
+## arrWords_01 = ["Perl", "is", "my", "friend"]
+## arrWords_02 = ["Perl", "and", "Raku", "are", "friend"]
+
+## Example 2
+## arrWords_01 = ["Perl", "and", "Python", "are", "very", "similar"]
+## arrWords_02 = ["Python", "is", "top", "in", "guest", "languages"]
+
+## Example 3
+arrWords_01 = ["Perl", "is", "imperative", "Lisp", "is", "functional"]
+arrWords_02 = ["Crystal", "is", "similar", "to", "Ruby"]
+
+arrOutput = [strLoop for strLoop in set(arrWords_01 + arrWords_02) if arrWords_01.count(strLoop) == 1 and arrWords_02.count(strLoop) == 1]
+
+print (len(arrOutput))