#5 most askedVery commonEasyPythonic code
List comprehensions
๐ข Asked in real interviews
No reports yet. Were you asked this? Be the first to say where.Using a comprehension, write squares_of_evens(nums) returning the squares of the even numbers, in order. Then explain when not to use comprehensions.
๐งช Practice
Write your solution, then press Run tests. Explain your approach out loud as you go.
def squares_of_evens(nums):
pass
Output appears here. Press Run or Ctrl/โ + Enter.
Try it first. Struggling for a few minutes is how it sticks.