Replace Function Syntax In Python