Math, asked by yogeshkumar4540, 5 months ago

Find the percentage of prime numbers laying between 10and 34 to the total number of numbers
sub \: to \: me \: my \: yt \: is \: bhumi \: gaming

Answers

Answered by satyamkumar6065
1

Answer:

thanks for free points

Answered by sumitsom4400
1

Answer:

print "Program to find the sum of prime numbers between 10 and 30."

print ""

print "Here is the list:"

def prime(n): # returns True if n is prime, False if not.

flag = True

for j in range(2,n+1):

if (n % j ==0 and j<>n): # n is composite (not prime).

flag = False

return flag

else:

if n ==j: # all possible divisors checked. Number,n is prime.

return flag

count = 0

scount = 0

for num in range(10,31):

if (prime(num)): # if flag is True...Its a prime!

count += 1

scount += num

print count,":",num," " ,

print ""

print "The sum of the",count,"primes between 10 & 30 is",scount

The program output:

Program to find the sum of prime numbers between 10 and 30.

Here is the list:

1 : 11 2 : 13 3 : 17 4 : 19 5 : 23 6 : 29

The sum of the 6 primes between 10 & 30 is 112

>>>

Good luck!

Similar questions