Function to check the characters are from the same row of the qwerty keypad
def checkValidity ( str ) : NEW_LINE INDENT x = str [ 0 ] NEW_LINE row = checkQwertyRow ( x ) NEW_LINE for i in range ( len ( str ) ) : NEW_LINE INDENT x = str [ i ] NEW_LINE if ( row != checkQwertyRow ( x ) ) : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT return True NEW_LINE DEDENT