Rotating Sign

Python for AIMedium+10 XP+10

Rotating Sign

A scrolling shop sign moves text to the left. Each step, the first letter leaves the front and comes back at the end.

Task: write rotate_left(text, steps) that returns text after steps moves.

  • After len(text) steps the text is back to where it started, so steps can be bigger than the length and it just keeps going round.
  • steps is never negative.
  • If text is empty, return "".

Examples

text = "python"
steps = 2
returns 'thonpy'
text = "abc"
steps = 0
returns 'abc'

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run