i wanted to count the no. of prime no. givrn out as product but thats not happening pls help. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

i wanted to count the no. of prime no. givrn out as product but thats not happening pls help.

lower=int(input("enter lower")) upper=int(input("enter upper")) sum=0 print('between',lower,'and',upper,'the following are prime numbers') for m in range(lower,upper+1): if m==1 or m==0: print(m,'is a special case') continue for n in range(2,m): if (m%n)==0: break else: print (m) sum+=1 print(sum)

24th Nov 2018, 3:54 PM
partha
partha - avatar
4 Answers
24th Nov 2018, 7:00 PM
Sarvesh Yadav
Sarvesh Yadav - avatar
+ 2
thanks Sarvesh ✓ but I don't want solution I need to know what's wrong with mine 😵 And I want to count the number of primes given by the range. 😫
25th Nov 2018, 12:27 AM
partha
partha - avatar
+ 2
Everything is fine but in last 2nd and 3rd indentation is required
25th Nov 2018, 11:14 AM
Sarvesh Yadav
Sarvesh Yadav - avatar
+ 2
Here is fixed version of your code. https://code.sololearn.com/csXmRNpJ7x2l/?ref=app
25th Nov 2018, 11:19 AM
Sarvesh Yadav
Sarvesh Yadav - avatar