题解 | #HJ12 字符串反转#
字符串反转
https://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
# 方法1:reversed
# print(''.join(reversed(input())))
# 方法2:切片
print(input()[::-1])
字符串反转
https://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
# 方法1:reversed
# print(''.join(reversed(input())))
# 方法2:切片
print(input()[::-1])
相关推荐
查看15道真题和解析
那场寒冬:字节入职后完全看组有没有hc,暑假实习只是一个名字