Indivisible Numbers
This Program name is Indivisible Numbers. Write a Python program to Indivisible Numbers
The below link contains Indivisible Numbers question, explanation and test cases
https://drive.google.com/file/d/1f7eIquKcLG9PWczki8tG3PWLRrqX3HR1/view?usp=sharing
We need exact output when the code was run
def isDivisible(K):
counter=0
for n in range(2,11):
if K%n==0:
counter+=1
return (counter>0)
N=int(input())
indivisibleNumber=0
for K in range(1,N+1):
if not isDivisible(K):
indivisibleNumber +=1
print(indivisibleNumber)
Comments
Leave a comment