---
title: "str"
space: "Student Handbook"
url: "https://portal.cs17.org/student-handbook/python-manual/built-in-functions/str"
updated: "2026-10-05"
---

Converts a value to a string (text).

## Synopsis

```python
str(value)
```

## Description

You need `str` to join a number to text with `+`. An f-string is often easier: it converts for you.

## Parameters

| Name | Meaning |
| --- | --- |
| `value` | Any value. |

## Return value

A `str`.

## Example

```python
age = 14
print("I am " + str(age) + " years old")
print(str(3.5) + "!")
```

It prints:

```text
I am 14 years old
3.5!
```

## Common mistake

```python
age = 14
print("I am " + age + " years old")
```

Python stops with:

```text
TypeError: can only concatenate str (not "int") to str
```

`+` can join two strings or add two numbers, but not one of each. Convert with `str`, or use an f-string.

## See also

[f-strings](/student-handbook/python-manual/strings/f-strings), [int](/student-handbook/python-manual/built-in-functions/int)

[str in the Python documentation](https://docs.python.org/3/library/functions.html#func-str)
