- 1
Can anyone bring the output
def main(): testCase = int(input()) while testCase>0: LR = list(map(int,input().strip().split())) L = LR[0] R = LR[1] lst=[] flag=1 for i in range(L,R+1): isPrime = True for num in range(2, int(i ** 0.5) + 1): if i % num == 0: isPrime = False flag = -1 break if isPrime: lst.append(i) n=len(lst) if n>1: print(max(lst)-min(lst)) elif n==1: print(0) elif flag==-1: print(-1) testCase -=1 main()
3 Respuestas
+ 3
Hi! Have you heard about indentation?
+ 1
Put your code in a Playground file and link it here so I can test it!
0
I have identified output !