From Functools Import Reduce Python