Skip to main content
← Back to Code Arena
Easy Rookie SpeedRun comprehensions builtins math

Python: Sum of Squares Comprehension

+100 XP · 5 min · attempt 1

Problem

What integer does the following expression evaluate to?

    sum([x * x for x in range(5)])

Enter a single integer.

Starter

# Trace through range(5) -> 0, 1, 2, 3, 4
# Square each, then sum.

Your answer

Playing as a guest — you'll be asked for a display name on submit. Log in to keep your XP across devices.