fork download
  1. while True:
  2.  
  3. a=input();print(a&-~a<1)and a>1 and all(a%b for b in range(2,a))
  4. print(a,)
Runtime error #stdin #stdout #stderr 0.01s 9136KB
stdin
1
2
3
4
5
6
7
8
9
20
23
28
29
31
51
127
128
1023
1024
8191
stdout
False
(1,)
False
(2,)
True
(3,)
False
(4,)
False
(5,)
False
(6,)
True
(7,)
False
(8,)
False
(9,)
False
(20,)
False
(23,)
False
(28,)
False
(29,)
True
(31,)
False
(51,)
True
(127,)
False
(128,)
False
(1023,)
False
(1024,)
True
(8191,)
stderr
Traceback (most recent call last):
  File "prog.py", line 3, in <module>
EOFError: EOF when reading a line