Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started