Update kama55.右旋字符串.md

添加python解法,已在kama上测试通过
This commit is contained in:
zhaohanyan
2024-02-22 12:05:47 -05:00
committed by GitHub
parent 6be53682d0
commit 2c160f31c5

View File

@ -211,7 +211,17 @@ public class Main {
```
### Python:
```Python
#注意python中字符串是不可变的所以使用python一定要创建新的字符串
#获取输入的数字k和字符串
k = int(input())
s = input()
#通过切片反转第一段和第二段字符串
s = s[len(s)-k:] + s[:len(s)-k]
print(s)
```
### Go
```go