Largest and Smallest N | Function to return the largest N - digit number in Hexa - Decimal Number System ; Append ' F ' N times ; Function to return the smallest N - digit number in Hexa - Decimal Number System ; Append '0' ( N - 1 ) times to 1 ; Function to print the largest and smallest N - digit Hexa - Decimal number ; Driver code
def findLargest ( N ) : NEW_LINE INDENT largest = ' F ' * N NEW_LINE return largest ; NEW_LINE DEDENT def findSmallest ( N ) : NEW_LINE INDENT smallest = '1' + '0' * ( N - 1 ) NEW_LINE return smallest ; NEW_LINE DEDENT def printAns ( largest ) : NEW_LINE INDENT print ( " Largest : ▁ " , findLargest ( largest ) ) ; NEW_LINE print ( " Smallest : ▁ " , findSmallest ( largest ) ) ; NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = 4 ; NEW_LINE printAns ( N ) ; NEW_LINE DEDENT