Method Python Definition Function Math Problem