Skip to content

Commit

Permalink
Merge pull request #179 from eduardosm7/master
Browse files Browse the repository at this point in the history
Add list of prime number on python #76
  • Loading branch information
ambujraj authored Oct 2, 2018
2 parents 3a2ae56 + 30902a2 commit a852131
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions prime/list_of_prime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
number = int(input("Input a number to generate a list of prime numbers smaller itself: "))

def is_prime(num):
for i in range(2, num):
if num % i == 0:
return False
return True

for i in range(2, number+1):
if is_prime(i):
print(i)

0 comments on commit a852131

Please sign in to comment.