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
Connectez-vous pour voir l'historique des soumissions
Se connecterConnectez-vous pour utiliser le Mentor IA
Se connecterVisible 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