Statistics Function In Python Definition