Can you write me the Python code for this?