- 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()

6th May 2021, 11:01 AM
Disha Jain
3 Réponses
+ 3
Hi! Have you heard about indentation?
6th May 2021, 11:52 AM
Per Bratthammar
Per Bratthammar - avatar
+ 1
Put your code in a Playground file and link it here so I can test it!
7th May 2021, 9:54 AM
Per Bratthammar
Per Bratthammar - avatar
0
I have identified output !
7th May 2021, 8:30 AM
Kumar Sharma
Kumar Sharma - avatar