> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/programming/courses/python-pcap-31-03-course/overview-and-introduction/format-method.md).

# Format Method

## Format method

```python
sentence = "The sum of 5 + 10 is {0}".format(50)
```

* This will replace `{0}` with the value provided in the `format` method
* You can pass multiple args as well:

```python
sentence = "The sum of {0} + {0} is {0}".format(50)
# Since all the data is {0} it means that it will take only the first arg from the format function

sentence = "The sum of {0} + {1} is {2}".format(50, 10, 60)
# Here each arg will be taken accordingly and it will do:
# 50 + 10 = 60
```
