Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Full lesson preview

Create a Number Variable

Practice assigning and returning a numeric variable. Learn how to store numbers in variables and return them from functions.

Python practice8 minVariables & Data TypesBeginnerLast updated December 29, 2025

Problem statement

Implement create_number_variable() that creates a number variable with the value 42 and returns it. This exercise focuses on using a numeric literal, storing it in a variable, and returning that variable.

Task

Create a function that defines a number variable and returns it.

Examples

Example - return the value

Input

create_number_variable()

Output

42

The function should create a variable holding 42 and return it.

Input format

No input parameters.

Output format

An integer value (42).

Constraints

Return exactly the integer 42. Do not print anything.

Samples

Sample 1

Input

create_number_variable()

Output

42

The function returns the stored numeric value.