# Revising the Difference between Methods and Functions

## What's the difference between a function and a method?

**In python everything is an object** **A `method` gets invoked on a given Object**

```python
mylist = [1,2,3,4]
mylist.pop()
```

**A `function` does not get invoked on a given Object, it exists on it's own**

```python
maxvalue = max([1,2,3,4])
print(maxvalue)
```

A function cannot be invoked before it was defined:

```python
myname()

def myname():
	print("imtiaz")
```

## What is OOP?

* It is a way to organize the code better rather than keeping everything in one file
* Dumping everything in a single file would be very difficult to manage, so OOP allows you to keep a structure and a logical narative
* OOP allows us to re-use code that we have already written
* Break things into chunks and using multiple files


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/programming/courses/python-pcap-31-03-course/modules-packages-and-oop/revising-the-difference-between-methods-and-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
