Using Reduce Function In Python