EXCEPTION: TypeError: reduce() of empty sequence with no initial value on line 1