Answer to Question #227194 in Python for vicky

Question #227194

You are given a positive integer N. Your task is to find the number of positive integers K <= N such that K is not divisible by any of the following numbers 2, 3, 4, 5, 6, 7, 8, 9, 10.


1
Expert's answer
2021-08-18T06:51:33-0400
N = int(input("enter positive number: "))
K=[]
nos=[2,3,4,5,6,7,8,9,10]
for i in range (1, N+1):
	for value in nos:
		if N%i==0 and i%value!=0:
			K.append(i)




#remove duplicates
K=list(set(K))	
count=0
#count 
for every in K:
	count= count+1		
print(count)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS