Anonymous user
Primality by Wilson's theorem: Difference between revisions
m
→{{header|Python}}: polish the code a bit
m (→{{header|Polyglot:PL/I and PL/M}}: fix tags) |
m (→{{header|Python}}: polish the code a bit) |
||
Line 1,456:
def is_wprime(n):
return
n > 1
(n % 2 and (factorial(n - 1) + 1) % n == 0))▼
and n % 2 != 0
)
if __name__ == '__main__':
c = int(input('Enter upper limit: '))
print(f
print([n for n in range(c) if is_wprime(n)])</lang>
|