Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Problem No 5

Create a Number Variable

Easy

8 minute session

Summary

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

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

Explanation

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 input 0

create_number_variable()

Sample output 0

42

Explanation 0

The function returns the stored numeric value.

Code editor
Loading editor…

AI assistant

Ask me anything!

Need help? I can explain the core idea behind this problem, review your current code, and give targeted hints. Use “Teach Theory” for the concept, “Get AI hint” for a quick scaffold nudge, or ask a specific question below.

Chat history is temporary and will not be saved.

05:02 AM

Free preview includes 1 Teach Theory response and 1 AI hint per unlocked preview lesson.