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.

Revisions

  1. ghostlyman renamed this gist Feb 26, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. ghostlyman created this gist Feb 26, 2016.
    14 changes: 14 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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')