上一页 1 ··· 15 16 17 18 19
摘要: >>> import random>>> import time>>> x=list(range(10000))>>> y=set(range(10000))>>> z=dict(zip(range(1000),range(10000)))>>> r=random.randint(0,9999)>> 阅读全文
posted @ 2017-05-22 22:00 JustLittle 阅读(245) 评论(0) 推荐(0)
摘要: >>> import string>>> import random #组合字符>>> x=string.ascii_letters+string.digits+string.punctuation>>> x'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS 阅读全文
posted @ 2017-05-22 14:34 JustLittle 阅读(399) 评论(0) 推荐(0)
摘要: >>> seq=['foo','x41','?','***']>>> def func(x): return x.isalnum() >>> list(filter(func,seq))['foo', 'x41']>>> seq['foo', 'x41', '?', '***']>>> [x for 阅读全文
posted @ 2017-05-20 22:05 JustLittle 阅读(343) 评论(0) 推荐(0)
摘要: >>> import math>>> math.sin(0.5)0.479425538604203>>> >>> import random>>> x=random.random()>>> n=random.randint(1,100)>>> import numpy as np>>> a = np 阅读全文
posted @ 2017-05-19 17:37 JustLittle 阅读(218) 评论(0) 推荐(0)
摘要: >>> def is_not_empty(s): return s and len(s.strip()) > 0 >>> filter(is_not_empty, ['test', None, '', 'str', ' ', 'END'])<filter object at 0x1056a3518> 阅读全文
posted @ 2017-05-18 20:51 JustLittle 阅读(483) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19