how to find the output in python