First Prime Number
This Program name is First Prime Number. Write a Python program to First Prime Number, it has two test cases
The below link contains First Prime Number question, explanation and test cases
https://docs.google.com/document/d/1VyIWTfBFSXtNuAtIzk9bDqD_q3cMl1sU/edit?usp=sharing&ouid=107231566038157986423&rtpof=true&sd=true
We need exact output when the code was run
def is_prime(n):
Flag=1
if n <=1:
Flag=0
else:
for i in range(2, n):
if n % i == 0:
Flag=0
if(n==2): Flag=0
return(Flag)
N = int(input("Enter N = "))
Nums = []
Flag=0
k=0
for r in range(0,N):
t = int(input())
Nums.append(t)
if(Flag==0):
Flag=is_prime(t)
k = t
if(Flag):
print("First Prime Number = ",k)
else:
print("There is no prime number in the list")
Comments
Leave a comment