Optimize a Python code snippet for better performance
Optimize the following Python code snippet for performance: [PYTHON_CODE_SNIPPET]. Focus on reducing execution time and memory usage while maintaining readability.
Use this when you need to improve the performance of a Python script.