Replace Function In Python Syntax