From 01f661d6a75515c73a640c9f9057e6af33603c1b Mon Sep 17 00:00:00 2001 From: Michael Mutote <130656746+mr1Michael@users.noreply.github.com> Date: Wed, 11 Oct 2023 20:34:17 +0200 Subject: [PATCH] 22202956 Question 1 corrected Question 4 was incorrect. removed it. Question 5 done. Question 6 done. --- 2.7 Exercises.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/2.7 Exercises.py b/2.7 Exercises.py index 12622fe..91b1cd5 100644 --- a/2.7 Exercises.py +++ b/2.7 Exercises.py @@ -1,6 +1,6 @@ # question 1 def rotateR(val): - return val[-1] + val[1:len(val)] if len(val) > 0 else None + return val[-1] + val[:-1] if len(val) > 0 else None @@ -24,4 +24,6 @@ def rotateRx_modified(val): # So the only way to achieve this would be to return a value and assign it back. pass - +# question 6 +def rotateR2(val): + return rotateR(rotateR(val)) -- GitLab