Use consistent string format in Python code