# How to Calculate the Sum of a List in Python

If you need to calculate and get the sum of a list in Python, then you can do the following.

## Option 1 – Using `sum()`

If you get a `TypeError`

then you can do the following:

If you need to calculate and get the sum of a list in Python, then you can do the following.

`sum()`

If you get a `TypeError`

then you can do the following:

`for`