Question: (I need help coding problem; an explanation would be appreciated. In Python, please, Thank you.) Implement a function `roll` that takes in a string and

(I need help coding problem; an explanation would be appreciated. In Python, please, Thank you.)

Implement a function `roll` that takes in a string and "rolls" it as follows.

~~~ Input: hello Output: elloh

Input: world Output: orldw

Input: abcd Output: bcda

Input: // Empty String Output: // Empty String ~~~

// YOUR CODE HERE ???

//BEGIN TEST testWithMessage(roll(""),"", "Test1") testWithMessage(roll("z"),"z", "Test2") testWithMessage(roll("hello"),"elloh", "Test3") testWithMessage(roll("ananas"),"nanasa", "Test4") testWithMessage(roll("za"),"az", "Test5") passed(5) //END TEST

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!