aboutsummaryrefslogtreecommitdiff
path: root/challenge-250/zapwai/python/ch-2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-250/zapwai/python/ch-2.py')
-rw-r--r--challenge-250/zapwai/python/ch-2.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-250/zapwai/python/ch-2.py b/challenge-250/zapwai/python/ch-2.py
new file mode 100644
index 0000000000..b7d48ba00c
--- /dev/null
+++ b/challenge-250/zapwai/python/ch-2.py
@@ -0,0 +1,13 @@
+import re
+def proc(a):
+ nums = list( map( lambda x: len(x), a ) )
+ pattern = r'\b(\d+)\b'
+ for i in range(len(a)):
+ if re.search(pattern,a[i]):
+ nums[i] = int(re.search(pattern, a[i]).group(1))
+ print("Input: ", a)
+ print("Output: ", max(nums))
+a = ("perl", "2", "000", "python", "r4ku");
+proc(a)
+a = ("001", "1", "000", "0001");
+proc(a)