摘要: 字符串操作 1.字符串的翻转 # 方式一 s = 'hello world' print(s[::-1) # 方式二 from functools import reduce print(reduce(lambda x,y:y+x, s)) 2.判断字符串是否是回文 利用字符串翻转操作可以查看字符串 阅读全文
posted @ 2023-11-08 16:47 Python探索牛 阅读(115) 评论(0) 推荐(0) 编辑