Rotate Left
This works like scrolling text: the beginning of the string moves to the end, and the rest shifts forward. Write a function left2 that takes a string s with length at least 2. Move the first two characters to the end and return the resulting string.
Примеры
Ввод
"Hello"Вывод
"lloHe"Ввод
"java"Вывод
"vaja"Ввод
"Hi"Вывод
"Hi"Нужно реализовать
def left2(s: str) -> str:
Теги
strings
Inicia sesión para ver tu historial de envíos
Iniciar sesiónInicia sesión para usar el AI Mentor
Iniciar sesiónVisible tests
1
Input
"Hello"Expected
"lloHe"2
Input
"java"Expected
"vaja"3
Input
"Hi"Expected
"Hi"4
Input
"abcd"Expected
"cdab"5
Input
"HelloHello"Expected
"lloHelloHe"6
Input
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Expected
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Focus radio
Paused · SomaFM · Fluid