python code better