I don't understand the code

I’m learning django for work, I’m stuck on a point from the documentation Writing your first Django app, part 2 | Django documentation | Django
in particular on the game with API there is a code that must be inserted somewhere, but I do not understand where, please advise me.

I used AI hint but the code gives almost 40 errors

The “Playing with the API” section are commands that you run in the interactive shell. You do not insert them as lines of code into your program.

The tutorial specifies that you run the following command from the command prompt:
python manage.py shell. That gives you the interactive shell. You type those lines in at that point.

Thank you so much for the tip, I didn’t realize.