Intermediate
Python Loop Optimization
Refactor a standard for-loop into a more efficient Python list comprehension.
📝 프롬프트 내용
Review the following Python code snippet which uses a for-loop to create a list of squared numbers from 1 to 10. Refactor this code into a single line using list comprehension. Additionally, explain why list comprehensions are generally considered more Pythonic and readable for this specific scenario.