1.请尝试用Filter()显示1~100的素数。
[p for p in range(1,100) if True not in [p%x==0 for x in range(2,p)]] for n in filter(lambda args:True not in [args%p ==0 for p in range(2,args)],range(2,101)): print (n)
1.请尝试用Filter()显示1~100的素数。
[p for p in range(1,100) if True not in [p%x==0 for x in range(2,p)]] for n in filter(lambda args:True not in [args%p ==0 for p in range(2,args)],range(2,101)): print (n)