美文网首页
Python自编程序一

Python自编程序一

作者: 花_椒_ | 来源:发表于2018-12-22 00:22 被阅读0次

先上程序!!!!

切片并连接字符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)

嘻嘻,简单第一步,再接再厉~

相关文章

网友评论

      本文标题:Python自编程序一

      本文链接:https://www.haomeiwen.com/subject/ipmbkqtx.html