Home > other >  Python solution
Python solution

Time:10-13

Don't come out 2, exclude the multiples of 5, for help

CodePudding user response:

Your first function always returns TRUE, you need to add one else

CodePudding user response:

 
Def Prime (n) :
If n & lt;=2:
Return True
For j in range (2, n) :
If n % j==0:
Return False
Return True


For I in range (1100) :
# g you
10 # s
If I/10 & gt; 0:
G=% 10 I
S=int (I/10)
The else:
G=I
# 10, n=2
If s!=0:
Res=s g * * * * 2 + 2
Str_res=f {' s} {g}, {s} {g} * * * * 2 + 2={res} '
The else:
Res=g * * 1
Str_res='{g} : f * * 1={g} {res}'
If res==1:
The continue
If Prime (res) :
Print (str_res)
  • Related