S = 'hhlholklmh' lt = [] s = '' def nixu(): for i in S : lt.append(ord(i)) return lt nixu() lt.reverse() for j in lt: s = s + chr(j) print(s)
# 实现一个字符串的逆序函数
最新推荐文章于 2022-12-14 19:08:14 发布
S = 'hhlholklmh' lt = [] s = '' def nixu(): for i in S : lt.append(ord(i)) return lt nixu() lt.reverse() for j in lt: s = s + chr(j) print(s)