摘要: exercise: Given a string of digits, you should replace any digit below 5 with '0' and any digit 5 and above with '1'. Return the resulting string. Not 阅读全文
posted @ 2022-06-27 17:39 大序列 阅读(16) 评论(0) 推荐(0) 编辑
摘要: def double_char(s): s2 = '' for i in s: i += i s2 += i return s2 *replace()函数 *tanslate()-str.maketrans(oldstr, newstr, delstr) 阅读全文
posted @ 2022-06-27 15:01 大序列 阅读(24) 评论(0) 推荐(0) 编辑