# type()

*noun*

say it: **“TYP”** **/taɪp/**

A built-in Python function that tells you the data type of a value, such as int for 42 or str for "hello".

## What does `type()` do?

`type()` tells you the data type of a value. Handy when something isn't behaving the way you expect.

```python
print(type(42))       # <class 'int'>
print(type("hello"))  # <class 'str'>
```

## In a sentence

- “print(**type**(3.5)) shows &lt;class 'float'>.”
- “**type()** showed that the "number" from input() was really a str.”

Level: Novice · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=1)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/type
