Definition
Where do you actually write and run Python?
A Python environment is the set of tools used to write and run Python: the interpreter that runs the code, an editor or notebook to write it in, and the libraries the code uses. Common choices are a browser playground, Jupyter notebooks, VS Code and Google Colab.
In simple words
For learning, the playground on this site is enough: it runs Python in your browser with nothing to install. Data scientists like notebooks, where code and results sit together in cells. Developers building full applications use an editor such as VS Code. Colab is a free online notebook with a GPU for heavier AI work.
Why it matters
Choosing the right tool saves time. Every later module uses notebooks for data work and an editor for building applications, so knowing both from the start makes the rest smoother.
How it works
| Tool | Best for | Install needed? |
|---|---|---|
| Browser playground (this site) | Learning and quick experiments | No |
| Jupyter notebook | Data analysis with code and charts together | Yes, or use Colab |
| Google Colab | Notebooks with free GPUs, in the cloud | No, needs a Google account |
| VS Code | Full projects with many files | Yes |
In a notebook, code lives in cells. You run one cell at a time, and the output appears right below it. Variables stay in memory between cells.
In code
A quick check that Python works, wherever you run it.
import sys
print("Python is working!")
print("Major version:", sys.version_info.major)
print("2 to the power 10 is", 2 ** 10)Output
Python is working! Major version: 3 2 to the power 10 is 1024
Try it yourself
Match the tool to its use
Which tool fits each situation best?
- Trying a line of Python on a school computer with nothing installed
- Exploring a dataset with charts next to the code
- Training a model that needs a GPU, for free
- Building an app with many files
Open and run a notebook
Optional, if you have a Google account.
- Open colab.research.google.com and create a new notebook.
- Type print("Hello from a notebook") in the first cell and press Shift + Enter.
- In a new cell, set x = 5. In the next cell, print x * 2. Notice that x is remembered.
Common mistakes
- Spending hours installing tools before writing any code. Start in the browser.
- Running notebook cells out of order and getting confusing results.
- Mixing up Python 2 and Python 3 tutorials. Always use Python 3.
Check yourself
Summary
- An environment is the interpreter, an editor or notebook, and libraries.
- Start in the browser; use notebooks for data and editors for apps.
- Colab gives free cloud notebooks with GPUs.
Finished reading?
Sources: Project Jupyter