Question: USING PYTHON 3.7 I can't figure out why my code won't work. Please help me troubleshoot print(This code finds and counts the number of prime

USING PYTHON 3.7

I can't figure out why my code won't work. Please help me troubleshoot

USING PYTHON 3.7 I can't figure out why my code won't work.

print("This code finds and counts the number of prime numbers between 2 and 100")

lower_bound = 2 upper_bound = int(100)

count = 0 for val in range(lower_bound,upper_bound + 1): for n in range (2,val): if (val % n) == 0: print(val,"is not prime") else: count += 1 print(val,"is prime") print("There are",count,"prime numbers between", lower_bound, "and", upper_bound)

Finding Prime Numbers: Write code that finds and counts the number of prime numbers between 2 and 100. The output should look similar to below: 2 is prime 3 is prime 4 is not prime 100 is not prime There are number of primes between 2 and 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!