Ad
  • Custom User Avatar

    For tuples addition is defined as concatenation, so sum(< iterator of tuples >, ()) simply concatenates the tuples generated by the zip object. We have to specify the starting value (second argument) as an empty tuple here, because by default sum() will start by adding 0 + < tuple > which will throw the TypeError exception.