I want to rotate the string so that its last character goes on the first place and so on.
word = "Burrow"
Sample Output:
Burrow
wBurro
owBurr
rowBur
rrowBu
urrowB
So far I can rotate the string in the opposite direction. Here's what I have done:
def main():
word = "Burrow"
a = word
for i in range(len(word)):
c = a[i:] + a[:i]
print(c)
if __name__ == "__main__":
main()
Burrow
urrowB
rrowBu
rowBur
owBurr
wBurro
Cannot find out what to do to get the desirable output. Tried negative indices but never succeeded.