Google Colab (Colaboratory) is a browser-based, hosted Jupyter notebook environment for running Python. It lets you try code without installing or maintaining Python locally. Notebooks are accessible from almost any device with a modern web browser, though Colab’s Python version may lag behind the latest release. section 2.2 section 2.2.3
To open a notebook from GitHub:
- Open a .ipynb file in GitHub and click Open in Colab above its contents. section 2.2.2
- Alternatively, visit https://colab.research.google.com/, choose File → Open notebook, enter a GitHub repository URL, and select a notebook from the results. section 2.2.2
- You can view GitHub and Colab without an account, but running code and saving sessions or files requires signing in with a Google account. Edits to a notebook opened from GitHub do not change the repository. section 2.2.2 section 2.3
A notebook has Markdown-formatted text cells and executable code cells. Run a code cell with Ctrl-Enter, its Run command, or the button beside it; output appears directly below. Ctrl-Enter also finishes editing a text cell. The first run of a notebook loaded from GitHub may display a warning about its origin. section 2.3
Read an error where the output appears
Run `print("Hello, World!"` without the closing parenthesis. The error appears below the code cell, identifying the line and marking the location with a caret. Colab may offer Fix Error; inspect its proposed change before accepting it, especially for more complex code. section 2.3.2
An empty cell may also offer “Start coding or generate with AI.” Enter a focused prompt, generate code, and evaluate the result; refine the prompt if needed. AI code generation is optional. section 5.9.2 section 2.5.3
