diff --git a/2.7 Exercises.py b/2.7 Exercises.py index 12622fe695735cb685108ab2b9b329f045c00dff..91b1cd57043f22fafd9b81f6b78ee3a7fcc22499 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))