fork download
  1. for n in range(2, 10):
  2. for x in range(2, n):
  3. if n % x == 0:
  4. print(n, 'equals', x, '*', n//x)
  5. break
  6. else:
  7. print(n, 'is a prime number')
Success #stdin #stdout 0.02s 9944KB
stdin
Standard input is empty
stdout
2 is a prime number
3 is a prime number
4 equals 2 * 2
5 is a prime number
6 equals 2 * 3
7 is a prime number
8 equals 2 * 4
9 equals 3 * 3