Write a Python Program to Print Prime Numbers From 1 to N using for and if loop .
Answers
Answered by
0
Answer:
Python Program to Print all Prime Numbers between an Interval
1.#Take the input from the user:
2.lower = int(input("Enter lower range: "))
3.upper = int(input("Enter upper range: "))
4.for num in range(lower,upper + 1):
5.if num > 1:
6.for i in range(2,num):
7.if (num % i) == 0:
8.break.
Explanation:
Hope this answer will help you
Great Learning
Similar questions
Chemistry,
18 days ago
Biology,
18 days ago
History,
18 days ago
World Languages,
9 months ago
Psychology,
9 months ago
Social Sciences,
9 months ago