立即学习:https://edu.csdn.net/course/play/26755/340115?utm_source=blogtoedu
反转字符串
s = 'abcde'
# 循环
s1 = ""
for item in s:
s1 = item + s1
print(s1)
# 切片
print(s[::-1])
立即学习:https://edu.csdn.net/course/play/26755/340115?utm_source=blogtoedu
反转字符串
s = 'abcde'
# 循环
s1 = ""
for item in s:
s1 = item + s1
print(s1)
# 切片
print(s[::-1])