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

Returns a copy of a string in capitals.

## Synopsis

```python
text.upper()
```

## Description

Like `lower`, `upper` returns a new string and leaves the original alone.

## Return value

A new `str`.

## Example

```python
name = "ada"
print(name.upper())
print(name)
```

It prints:

```text
ADA
ada
```

## Common mistake

```python
print(upper("ada"))
```

Python stops with:

```text
NameError: name 'upper' is not defined
```

`upper` is a method, not a function on its own. Call it on the string: `"ada".upper()`.

## See also

[str.lower](/student-handbook/python-manual/strings/lower)

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