From 34cf44f41cf1ef42f5bade5b69d94d3576ba52cb Mon Sep 17 00:00:00 2001 From: R David <113769710+rdavid7121@users.noreply.github.com> Date: Wed, 5 Oct 2022 21:35:29 +0530 Subject: [PATCH] Update list-1.py --- list-1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list-1.py b/list-1.py index f01fbb6..8af1e4b 100644 --- a/list-1.py +++ b/list-1.py @@ -27,7 +27,7 @@ def common_end(a, b): element or they have the same last element. Both arrays will be length 1 or more. """ - return a[0] == b[0] or a[-1] == b[-1] + return (len(a) and len(b))>0 and a[0] == b[0] or a[-1] == b[-1] def sum3(nums):