题解 | #数字颠倒#
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
s=input()
#倒序遍历
# mylen=len(s)
# res=[]
# for i in range(mylen):
# res.append(s[mylen-i-1])
# print(''.join( res) )
#字符串切片特性s[首:尾:步长]
res=s[::-1]
print(res)
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
s=input()
#倒序遍历
# mylen=len(s)
# res=[]
# for i in range(mylen):
# res.append(s[mylen-i-1])
# print(''.join( res) )
#字符串切片特性s[首:尾:步长]
res=s[::-1]
print(res)
相关推荐
查看26道真题和解析