PRACTICE

Functions

Lesson notes

Your task

Define square(n) returning n * n, then print square(6).

Expected output
36
Loading…

OUTPUT

Worked solution
def square(n):
    return n * n

print(square(6))

Checks compare printed output, not your approach. Several solutions can be valid.

← Back to courses