Navbar menu
(Move to ...)
Home
Python
HTML
JavaScript
Quiz
AS400 / IBM iSeries
Contact Us
▼
Python program to find first 10 prime numbers
First 10 prime numbers
Code Snippet:
n = 10 count=0 answer=[] print("First ten prime no program in Python") for i in range(1,n+1): for j in range(2,n+1): if i % j == 0: count+=1 if count == 1: answer.append(i) count=0 print(answer)
Copy
First 10 prime number program in Python
Output:
Output - prime number
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment