Remove Method In String In Python Function Definition