立即学习:https://edu.csdn.net/course/play/26755/340115?utm_source=blogtoedu
如何反转字符串:
s1='abcde'
s2=""
for c in s1:
s2=c+s2
print(s2)
分片
print(s1[::-1])
立即学习:https://edu.csdn.net/course/play/26755/340115?utm_source=blogtoedu
如何反转字符串:
s1='abcde'
s2=""
for c in s1:
s2=c+s2
print(s2)
分片
print(s1[::-1])