for n in range(2, 10): for x in range(2, n): if n % 2 == 0: print n, ‘equals‘, x, ‘*‘, n / x break else: print n, ‘is a prime number‘
时间: 2024-10-24 06:25:43
for n in range(2, 10): for x in range(2, n): if n % 2 == 0: print n, ‘equals‘, x, ‘*‘, n / x break else: print n, ‘is a prime number‘