intermediate
Python List Comprehension Debug
Identify and fix a logical error in Python code.
📝 Contenu du Prompt
Analyze the following Python code snippet intended to create a list of squared even numbers: 'squares = [x**2 for x in range(10) if x % 2 = 0]'. Identify the syntax error, explain why it causes an error, and provide the corrected code.