File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,16 @@ def fun():
9
9
input_num_list = list (map (int ,input ().strip ().split (',' )))
10
10
out = set ()
11
11
for num in input_num_list :
12
- if (num != 1 and all (num % i != 0 for i in range (2 ,int (math .sqrt (num ))+ 1 ))):
13
- ##### Return True if all elements of the iterable are true (or if the iterable is empty)
14
- ##### So, if the input_num_list contain {1}, the result is wrong
15
- out .add (num )
16
- # flag= True
17
- # for i in range(2,int(math.sqrt(num))+1):
18
- # if (num%i):
19
- # flag= False
20
- # break
21
- # if(flag and num!=1): out.add(num)
12
+ # if(num !=1 and all(num%i !=0 for i in range(2,int(math.sqrt(num))+1))):
13
+ # ##### Return True if all elements of the iterable are true (or if the iterable is empty)
14
+ # ##### So, if the input_num_list contain {1}, the result is wrong
15
+ # out.add(num)
16
+ flag = True
17
+ for i in range (2 ,int (math .sqrt (num ))+ 1 ):
18
+ if (num % i == 0 ):
19
+ flag = False
20
+ break
21
+ if (flag and num != 1 ): out .add (num )
22
22
23
23
out = sorted (out )
24
24
if (len (out )== 0 ):
You can’t perform that action at this time.
0 commit comments