Header Ads

Check Number is Prime or Not Prime in a List using Python | List Number is Prime or Not Prime using Python

In this Post We Check Number is Prime or Not Prime in a List using Python Very Simple Example 


Output:

Prime, list, prime number, list prime number, prime number in list,number is prime or not in list,prime number list, not prime number, number is prime or not





Program Source Code:


myList = [7,8,9,4,3,13,17,22,23]
l =
len(myList)
for i in range(0 , l):
    c =
0
   
for j in range(2,myList[i]):
       
if myList[i]%j == 0:
            c=
1
           
break
    if
c == 0:
       
print(myList[i], " is prime number")
   
else:
        
print(myList[i], " is Not Prime"
)

Related Video



No comments

Powered by Blogger.