write a program to find the first prime number in the given inputs
"""Define a function wich check the given number is prime"""
def isPrime(num:int)->bool:
if(num==1):
return False
i=2
while i*i<=num:
if num%i==0:
return False
i+=1
return True
nums=list(map(int,input("Please input nummbers: ").split()))
for nm in nums:
if isPrime(nm):
print("The first prime number: "+str(nm))
break
Comments
Leave a comment