MCPcopy Create free account
hub / github.com/geekcomputers/Python / rotate

Function rotate

string_rotation.py:7–15  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

5
6
7def rotate(n):
8 a = list(n)
9 if len(a) == 0:
10 return print([])
11 l = []
12 for i in range(1, len(a) + 1):
13 a = [a[(i + 1) % (len(a))] for i in range(0, len(a))]
14 l += ["".join(a)]
15 print(l)
16
17
18string = str(input())

Callers 1

string_rotation.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected