#输出ascii码
symbols = '#$%%^&'
codes = []
for symbol in symbols:
codes.append(ord(symbol))
#筛选
asc = [ord(s) for s in symbols if ord(s) > 57]
#利用map和fiter来进行创建
f_asc = list(filter(lambda c: c>57, map(ord, symbols)))
#元祖拆包
a, b, *rest = range(5)
#当前输出为[2,3,4]
流畅的python--第二章 数据结构
猜你喜欢
转载自blog.csdn.net/weixin_42307828/article/details/104079907
今日推荐
周排行