字符串

1.将to be or not to be字符串倒序输出

a='to be or not to be'
b=a[::-1]
print(b)

2.将sxtsxtsxtsxtsxt字符串所有的S输出

a='sxtsxtsxtsxtsxt'
b=a[::3]
print(b)

posted @ 2019-12-24 20:44  青年小白学编程  阅读(196)  评论(0)    收藏  举报