先上程序!!!!
切片并连接字符or字符串循环左移
s=str(raw_input('Please input the string:'))
n=int(input('Please input the non-negative integer:'))
front=s[0:n:1]
tail=s[n: :1]
new_s=''.join([tail,front])
print(new_s)
嘻嘻,简单第一步,再接再厉~
先上程序!!!!
s=str(raw_input('Please input the string:'))
n=int(input('Please input the non-negative integer:'))
front=s[0:n:1]
tail=s[n: :1]
new_s=''.join([tail,front])
print(new_s)
嘻嘻,简单第一步,再接再厉~
本文标题:Python自编程序一
本文链接:https://www.haomeiwen.com/subject/ipmbkqtx.html
网友评论