#NEWLINE# def add( self , num1 , num2 ) : #NEWLINE# #INDENT# '\n        :param num1: list of digits in reverse order\n        :param num2: list of digits in reverse order\n        :return: list of digits in reverse order\n        ' #NEWLINE# num1 = list ( num1 ) #NEWLINE# num2 = list ( num2 ) #NEWLINE# if ( len ( num1 ) < len ( num2 ) ) : #NEWLINE# #INDENT# ( num1 , num2 ) = ( num2 , num1 ) #NEWLINE# #UNINDENT# carry = 0 #NEWLINE# for ind in range ( len ( num1 ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# result = ( ( num1 [ ind ] + num2 [ ind ] ) + carry ) #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# result = ( num1 [ ind ] + carry ) #NEWLINE# if ( result == num1 [ ind ] ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# carry = ( result / 10 ) #NEWLINE# num1 [ ind ] = ( result % 10 ) #NEWLINE# #UNINDENT# if ( carry != 0 ) : #NEWLINE# #INDENT# num1 . append ( carry ) #NEWLINE# #UNINDENT# return num1