Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Problem No 14

Use None as a Value

Easy

8 minute session

Summary

Learn how to return None from a function and understand how None is used as a value in Python.

Problem statement

Implement a function that accepts any single argument but always returns the Python value None. Do not print anything. When the test harness evaluates your function, remember that None will be represented as an empty string in the test comparison, so the correct return value is the Python None object.

Task

Implement a function that always returns None, regardless of the input provided.

Examples

Return None for number

Input

set_to_none(7)

Output

None

Explanation

The function should return None regardless of the provided value.

Return None for string

Input

set_to_none('hello')

Output

None

Explanation

Even a string input should result in None being returned.

Input format

A single argument of any type is passed to the function set_to_none(value).

Output format

Return None (the Python None object).

Constraints

Do not print. Always return None.

Samples

Sample input 0

set_to_none(100)

Sample output 0

None

Explanation 0

Regardless of the input, the function returns None.

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.

03:45 AM

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