Initialize the every row with size 2 ( 1 for numerator and 2 for denominator )
for i in range ( size ) : NEW_LINE INDENT arr [ i ] = [ 0 for i in range ( 2 ) ] NEW_LINE DEDENT arr [ 0 ] [ 0 ] = 9 NEW_LINE arr [ 0 ] [ 1 ] = 10 NEW_LINE arr [ 1 ] [ 0 ] = 12 NEW_LINE arr [ 1 ] [ 1 ] = 25 NEW_LINE arr [ 2 ] [ 0 ] = 18 NEW_LINE arr [ 2 ] [ 1 ] = 35 NEW_LINE arr [ 3 ] [ 0 ] = 21 NEW_LINE arr [ 3 ] [ 1 ] = 40 NEW_LINE