标签:python class print highlight 循环 for else lis form
a = [1, 2, 3] for i in a: if i > 2: a.insert(0, i) # a = 死循环 for i in a[:]: if i > 2: a.insert(0, i) # a = [3, 1, 2, 3]
for n in range(2, 10): for x in range(2, n): if n % x == 0: break else: print "{}是质数".format(n), # 2是质数 3是质数 5是质数 7是质数
标签:python class print highlight 循环 for else lis form
原文地址:http://www.cnblogs.com/lazySmeagol/p/7954113.html