Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions

Question

Identify the common mistakes that are made in a divorce.

Answered: 1 week ago

Question

Identify the hallucinogens, and describe their effects.

Answered: 1 week ago