Prime Generator-1

Description:

Write a program to find prime numbers between two range Input 1: Lower Range Input 2: Upper Range Output: List of prime numbers Refer sample input and output for formatting specification. Test Case 1 Input (stdin) 11 31 Expected Output 13 17 19 23 29 Test Case 2 Input (stdin) 7 15 Expected Output 11 13

Program :

lower = int(input(""))  

upper = int(input(""))  

lower=lower+1

upper=upper-1

 

for num in range(lower,upper + 1):  

   if num > 1:  

       for i in range(2,num):  

           if (num % i) == 0:  

               break  

       else:  

           print(num)