def rotateString(s, offset):
# write your code here
str_length = len(s)
str_new = s[str_length - offset:] + s[:str_length - offset]
return str_new
str_old = 'abcdefgh'
print(rotateString(str_old, 2))
python之lintcode刷题:rotate string
最新推荐文章于 2022-04-07 15:56:21 发布