← Python from Scratch Lesson 46 of 78 · 5 XP

Warm-up: a function calls a function warm-up

Theory and problem statement

Machine translation, not yet reviewed by a native speaker.

One function can call another. That's how a big task is built from small bricks:

def square(n):
    return n * n

def sum_of_squares(a, b):
    return square(a) + square(b)

print(sum_of_squares(2, 3))   # 4 + 9 = 13

Task. The square function is already written. Finish sum_of_squares(a, b) — it returns the sum of the squares of two numbers and uses square.

Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.