Find if a number is divisible by every number in a list | Python program which check is a number divided with every element in list or not ; Checking if a number is divided by every element or not ; Driver code
def findNoIsDivisibleOrNot ( n , l = [ ] ) : NEW_LINE INDENT for i in range ( 0 , len ( l ) ) : NEW_LINE INDENT if l [ i ] % n != 0 : NEW_LINE INDENT return 0 NEW_LINE DEDENT DEDENT return 1 NEW_LINE DEDENT l = [ 14 , 12 , 4 , 18 ] NEW_LINE n = 2 NEW_LINE if findNoIsDivisibleOrNot ( n , l ) == 1 : NEW_LINE INDENT print " Yes " NEW_LINE DEDENT else : NEW_LINE INDENT print " No " NEW_LINE DEDENT