Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- #----------------------------------------------------------------------------
- # Created by : Alain Van Kerckhoven
- # Created Date: 6 mars 2017
- # Licence : GPL
- # Version : 1.0
- # ---------------------------------------------------------------------------
- """
- Teste pour une suite de nombre lesquels sont premiers.
- """
- # ---------------------------------------------------------------------------
- for n in range(2, 100):
- for x in range(2, n):
- if n % x == 0:
- print (n, 'equals', x, '*', n // x)
- break
- else:
- # loop fell through without finding a factor
- print (n, 'is a prime number')
Add Comment
Please, Sign In to add comment