Reason:
In Python 3, the reduce() function has been removed from the global namespace and is now placed in the fucntools module
Fix: first import and then use
from functools import reduce
Reason:
In Python 3, the reduce() function has been removed from the global namespace and is now placed in the fucntools module
Fix: first import and then use
from functools import reduce