Skip to content

Instantly share code, notes, and snippets.

@ghostlyman
Last active February 26, 2016 09:33
Show Gist options
  • Save ghostlyman/6d68deb7c57c4728070f to your computer and use it in GitHub Desktop.
Save ghostlyman/6d68deb7c57c4728070f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#Filename: Python_Course01_Q04_Prime_checker.py
#This script is used to check the prime number.
list1 = [1,3,54,6,4,3,5,6,4,34,332]
x = 0
for num in list1:
if num > 1:
for i in range(2,num):
if (num % i) == 0:
break
else:
x += 1
print(x,'prime in the list')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment