medium
Python Function Refactoring
Optimize a Python function snippet for better readability and performance.
📝 Treść promptu
Review the following Python code snippet and refactor it for better readability and performance. Identify any bottlenecks and suggest a more Pythonic approach. [Insert Code Snippet Here]