摘要: 在做leetcode的试题中,做到反转整数,就涉及到字符串反转,为了尽可能可以写出更多的方法,于是写下这篇文章 样例:如 a='123456789' 反转成 a='987654321' 第一种方法:使用字符串切片 >>> a='123456789' >>> a = a[::-1] '98765432 阅读全文
posted @ 2021-11-28 14:50 咖啡陪你 阅读(8460) 评论(0) 推荐(0)