+ 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)
4 Answers
+ 3
Use this function
https://code.sololearn.com/c3UTdz27sV2D/?ref=app
+ 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. đ«
+ 2
Everything is fine but in last 2nd and 3rd indentation is required
+ 2
Here is fixed version of your code.
https://code.sololearn.com/csXmRNpJ7x2l/?ref=app