使用python进行字符顺序调换

使用python进行字符顺序调换

# 定义一个函数,用于反转字符串
def reverse_string(s):
    return s[::-1]

# 定义一个包含所有要反转的字符串的列表
strings = [
    "000000a2000000000000000000000000",
    "00000000000000000000000000000000",
    "0a0e1a003d5007000000000011000000",
    "b000aa025b00ba0124001f0103030000"
]

# 遍历字符串列表并输出反转后的字符串
for s in strings:
    reversed_s = reverse_string(s)
    #print("原始字符串: ", s)
    print("反转后的字符串: ", reversed_s)
    #print()
posted @ 2024-11-11 17:04  xswnb  阅读(8)  评论(0编辑  收藏  举报