Longest Subsequence of a String containing only Consonants | Returns true if x is consonants . ; '' Function to check whether a character  is consonants or not  ; Function to find the longest subsequence which contain all consonants ; Driver code ; Function call
def isComsomamts ( x ) : NEW_LINE INDENT x = x . lower ( ) NEW_LINE return not ( x == ' a ' or x == ' e ' or x == ' i ' or x == ' o ' or x == ' u ' ) NEW_LINE DEDENT def longestConsonantsSubsequence ( s ) : NEW_LINE INDENT answer = ' ' NEW_LINE n = len ( s ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT if isComsomamts ( s [ i ] ) : NEW_LINE INDENT answer += s [ i ] NEW_LINE DEDENT DEDENT return answer NEW_LINE DEDENT s = ' geeksforgeeks ' NEW_LINE print ( longestConsonantsSubsequence ( s ) ) NEW_LINE