From e5c4d56d01713495d0287b7a0a381e326f1b34f7 Mon Sep 17 00:00:00 2001 From: Henry Zheng <1204831218@qq.com> Date: Fri, 29 Mar 2024 11:26:09 +0800 Subject: [PATCH] =?UTF-8?q?update=20kama55.=E5=8F=B3=E6=97=8B=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2.md=20python=20=E5=88=87=E7=89=87=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/kama55.右旋字符串.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/problems/kama55.右旋字符串.md b/problems/kama55.右旋字符串.md index 71371860..0188918e 100644 --- a/problems/kama55.右旋字符串.md +++ b/problems/kama55.右旋字符串.md @@ -222,6 +222,13 @@ s = s[len(s)-k:] + s[:len(s)-k] print(s) ``` +```Python 切片法 +k = int(input()) +s = input() + +print(s[-k:] + s[:-k]) +``` + ### Go: ```go package main