Prime numbers using for loop

Question

Write a program to find all prime numbers between 25 and 50.

in progress 0
YashikaKhurana 55 years 1 Answer 987 views Master 0

Answer ( 1 )

  1. for num in range(25, 51):

    if num > 1:
    for i in range(2, num):

    if (num % i) == 0:

    break
    else:
    print(num)

Leave an answer

Browse
Browse