First Prime Number
You are given N inputs. Write a program to print the first prime number in the given inputs.
n = int(input("Enter number of integers: "))
numbers = []
for i in range(n):
number = int(input("Enter number: "))
isPrime=True
if number > 1:
for j in range(2, number):
if (number % j) == 0:
isPrime=False
break
if isPrime==True:
numbers.append(number)
print("The first prime number in the given inputs is: "+str(numbers[0]))
Comments
Working!!!! thank u
Leave a comment