As mention tell how you run code,IDLE/editor or command line.
Here is code online.
If on Windows look at Python 3.9/3.8 and pip installation under Windows
Here is code online.
If on Windows look at Python 3.9/3.8 and pip installation under Windows