python中sorted实战应用
来源:互联网 发布:淘宝小蓓澳洲代购真假 编辑:程序博客网 时间:2024/04/29 08:53
1.用小于5行的代码解决1.6题。
'''
'''
1.6 去除a字符串内的数字后,请将该字符串里的单词重新排序(a-z),
并且重新输出一个排序后的字符串。
(保留大小写,a与A的顺序关系为:A在a前面。例:AaBb)
'''
import string
a = "aAsmr3idd4bgs7Dlsf9eAF"
lst = sorted([x for x in a if x not in string.digits],reverse =True ,key=string.lower)
lst.reverse()
print ''.join(lst)
'''
'''
1.6 去除a字符串内的数字后,请将该字符串里的单词重新排序(a-z),
并且重新输出一个排序后的字符串。
(保留大小写,a与A的顺序关系为:A在a前面。例:AaBb)
'''
import string
a = "aAsmr3idd4bgs7Dlsf9eAF"
lst = sorted([x for x in a if x not in string.digits],reverse =True ,key=string.lower)
lst.reverse()
print ''.join(lst)
0 0
- python中sorted实战应用
- python中sorted()函数的应用
- python中sorted()函数
- python 中sorted()函数
- python 中sorted()函数
- python中sorted如何使用
- python 中 sort(), sorted(), argsort()
- Python 中 sorted 的用法
- Zabbix Python API 应用实战
- Python进阶(十三)-浅谈sorted 函数应用
- Redis中sorted sets的应用
- python3中 sort sorted 函数应用
- Python中sorted()方法的用法
- Python中sort以及sorted函数初探
- Python中sorted()方法的用法
- python中sort()、sorted()函数比较
- Python中sort 和 sorted函数
- Python中sorted()方法的用法
- 香港哪裡有做无创产前基因
- 香港无创dna多少钱
- 香港无创dna費用多少?
- 香港无创dna和国内的分別?
- 香港无创dna检验地址
- python中sorted实战应用
- 香港验血查男女中介
- 香港验血查男女准吗
- 香港验血查生男生女
- 香港验血鉴定性别的方法
- 香港验血鉴定性别地址
- 香港验血鉴定性别多少钱
- 香港验血鉴定性别预约
- 香港验血男孩诊所