Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Full lesson preview

Check Variable Types

Return the runtime type name of a value as a string.

Python practice8 minVariables & Data TypesBeginnerLast updated December 29, 2025

Problem statement

Write a function check_type(value) that returns the name of the runtime type of value as a string. Use Python's built-in type system to inspect the value. Examples of expected outputs: int, float, str, bool, list, dict, NoneType, etc.

Task

Understand how Python represents the type of a value and return its type name.

Examples

Integer example

Input

check_type(5)

Output

int

The value 5 is an integer, so the function returns 'int'.

Input format

A single Python value passed as the function argument.

Output format

A string with the type name, e.g. 'int' or 'str'.

Constraints

Do not use any external libraries. Use Python's built-in type introspection.

Samples

Sample 1

Input

check_type([1, 2, 3])

Output

list

A Python list has the type name 'list'.