> Source URL: /resources/data-types.guide
---
type: "note"
---
# Data Types

Data types tell you what kind of value you have.

## Common Types

* **int**: whole numbers, like `0`, `-7`, `42`

* **float**: decimal numbers, like `3.14`, `-0.5`

* **str**: text in quotes, like `"hello"` or `'CS'`

* **bool**: `True` or `False`

## Examples

```python
age = 17          # int
gpa = 3.8         # float
name = "Riley"    # str
is_student = True # bool
```

## Check a Type

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

## Convert Between Types

```python
int("7")      # 7
float("2.5")  # 2.5
str(100)      # "100"
```

*Note: converting a non-number string like&#x20;*`int("hi")`*&#x20;causes an error.*

⠀

---

## Backlinks

The following sources link to this document:

- [Data Types Guide](/resources/resources.index.llm.md)
- [>ref: █████████](/unit-1/projects/01-me-dot-py/me-dot-py.project.llm.md)
- [>ref: Data Types](/unit-1/projects/02-you-dot-py/you-dot-py.project.llm.md)
- [Data Types](/resources/input.guide.llm.md)
