# Method

*noun*

say it: **“METH-ud”** **/ˈmɛθəd/**

A function that belongs to a class, called on an object with a dot, such as cart.add("pen") or name.upper().

## What is a **method** in Python?

A **method** is a function that belongs to a class. You call it on an object with a dot.

```python
class Thermostat:
    def __init__(self):
        self.temp = 68

    def warm_up(self, degrees):
        self.temp += degrees

home = Thermostat()
home.warm_up(4)
print(home.temp)  # 72
```

## In a sentence

- “The Thermostat class has a **method** called warm_up that raises the temperature.”
- “"pizza".upper() calls the string's upper **method** and gives back "PIZZA".”

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

Updated: November 19, 2026

## In other subjects

- [Method in C#](https://www.ask-codey.com/glossary/method-c-sharp)
- [Method in Java](https://www.ask-codey.com/glossary/method-java)
- [Method in JavaScript](https://www.ask-codey.com/glossary/method-javascript)
- [Method in OOP](https://www.ask-codey.com/glossary/method-oop)

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