In Python, the code is not better, but better. The more complex the code is not better, but the simpler the better.
1 line of code to achieve the function, never write 5 lines of code. Always bear in mind that the less code, the higher the development efficiency.