of course can (almost) always be improved in terms of performance, but it helps to state
why you are trying to improve the performance of your code. There are countless bad reasons to try and optimize code, and often commenters here try to stop newer programmers from getting sucked down the rabbithole of trying to optimize in a way that is premature, or ultimately pointless. Your code is likely "fast enough" (again, explain why if you think it's not). If you are asking about curiosity of what is faster/slower in python, try to break it down into simpler, generally applicable components —
Hymns For Disco 25 secs ago