# Create Data with Many-to-Many Relationships
Let's continue from where we left and create some data.
We'll create data for this same **many-to-many** relationship with a link table:
We'll continue from where we left off with the previous code.
/// details | 👀 Full file preview
//// tab | Python 3.10+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001_py310.py!}
```
////
//// tab | Python 3.9+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001_py39.py!}
```
////
//// tab | Python 3.7+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001.py!}
```
////
///
## Create Heroes
As we have done before, we'll create a function `create_heroes()` and we'll create some teams and heroes in it:
//// tab | Python 3.10+
```Python hl_lines="11"
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001_py310.py[ln:36-54]!}
# Code below omitted 👇
```
////
//// tab | Python 3.9+
```Python hl_lines="11"
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001_py39.py[ln:42-60]!}
# Code below omitted 👇
```
////
//// tab | Python 3.7+
```Python hl_lines="11"
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001.py[ln:42-60]!}
# Code below omitted 👇
```
////
/// details | 👀 Full file preview
//// tab | Python 3.10+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001_py310.py!}
```
////
//// tab | Python 3.9+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001_py39.py!}
```
////
//// tab | Python 3.7+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001.py!}
```
////
///
This is very similar to what we have done before.
We create a couple of teams, and then three heroes.
The only new detail is that instead of using an argument `team` we now use `teams`, because that is the name of the new **relationship attribute**. And more importantly, we pass a **list of teams** (even if it contains a single team).
See how **Deadpond** now belongs to the two teams?
## Commit, Refresh, and Print
Now let's do as we have done before, `commit` the **session**, `refresh` the data, and print it:
//// tab | Python 3.10+
```Python hl_lines="22-25 27-29 31-36"
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001_py310.py[ln:36-69]!}
# Code below omitted 👇
```
////
//// tab | Python 3.9+
```Python hl_lines="22-25 27-29 31-36"
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001_py39.py[ln:42-75]!}
# Code below omitted 👇
```
////
//// tab | Python 3.7+
```Python hl_lines="22-25 27-29 31-36"
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001.py[ln:42-75]!}
# Code below omitted 👇
```
////
/// details | 👀 Full file preview
//// tab | Python 3.10+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001_py310.py!}
```
////
//// tab | Python 3.9+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001_py39.py!}
```
////
//// tab | Python 3.7+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001.py!}
```
////
///
## Add to Main
As before, add the `create_heroes()` function to the `main()` function to make sure it is called when running this program from the command line:
//// tab | Python 3.10+
```Python
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001_py310.py[ln:72-74]!}
# Code below omitted 👇
```
////
//// tab | Python 3.9+
```Python
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001_py39.py[ln:78-80]!}
# Code below omitted 👇
```
////
//// tab | Python 3.7+
```Python
# Code above omitted 👆
{!./docs_src/tutorial/many_to_many/tutorial001.py[ln:78-80]!}
# Code below omitted 👇
```
////
/// details | 👀 Full file preview
//// tab | Python 3.10+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001_py310.py!}
```
////
//// tab | Python 3.9+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001_py39.py!}
```
////
//// tab | Python 3.7+
```Python
{!./docs_src/tutorial/many_to_many/tutorial001.py!}
```
////
///
## Run the Program
If we run the program from the command line, it would output: