Add Edegs to the list
for i in range ( n - 1 ) : NEW_LINE INDENT u = edges [ i ] [ 0 ] - 1 NEW_LINE v = edges [ i ] [ 1 ] - 1 NEW_LINE adj [ u ] . append ( v ) NEW_LINE adj [ v ] . append ( u ) NEW_LINE DEDENT