Check whether K | Python3 code to check if k - th bit of a given number is set or not ; Driver code
def isKthBitSet ( n , k ) : NEW_LINE INDENT if n & ( 1 << ( k - 1 ) ) : NEW_LINE INDENT print ( " SET " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " NOT ▁ SET " ) NEW_LINE DEDENT DEDENT n = 5 NEW_LINE k = 1 NEW_LINE isKthBitSet ( n , k ) NEW_LINE