List Comprehensions Made Easy (Python)
Description
This snippet demonstrates list comprehension in Python, a concise way to create lists. It generates a list of squares from a range of numbers.
Code Snippet
# Generate a list of squares from 1 to 10 using list comprehension
squares = [x**2 for x in range(1, 11)]
# Print the list of squares
print(squares)