摘要: old_str = 'abcd' new_str1 = old_str[::-1] print(new_str1) new_str2 = ''.join(reversed(old_str)) print(new_str2) 阅读全文
posted @ 2019-03-01 21:14 噼里巴啦 阅读(143) 评论(0) 推荐(0) 编辑
摘要: old_dic = {'a':6, 'b':3, 'c':2, 'd':4, 'e':5, 'f':1}new_dic = sorted(old_dic.items(), key=lambda d:d[1])print(new_dic)x = zip(old_dic.values(), old_di 阅读全文
posted @ 2019-03-01 21:08 噼里巴啦 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 1 第一种方法利用了集合 2 第二种方法利用了遍历查找 阅读全文
posted @ 2019-03-01 20:48 噼里巴啦 阅读(532) 评论(0) 推荐(0) 编辑
摘要: 主要使用的itertools库 阅读全文
posted @ 2019-03-01 20:44 噼里巴啦 阅读(3612) 评论(0) 推荐(0) 编辑