2. Setting up the Python Environment
2. Setting up the Python Environment
To start programming in Python, you need to set up your development environment: To set up Python:
Download Python from python.org
Install Python, ensuring to add Python to PATH
Verify installation by opening a command prompt and typing
python --versionInstall an Integrated Development Environment (IDE) like PyCharm , Visual Studio Code, Jupyter Notebook, Google Colab or use IDLE (comes with Python). In our case, we will use Google Colab in most cases in the coding practices.
# Example Code
import sys
print(f"Python version: {sys.version}")
print(f"Python executable Path: {sys.executable}")Tools:
VS Code:
Install Python.
Install VS Code, then add the Python extension.
Create a
.pyfile and run withCtrl+F5.
Google Colab:
Browser-based: colab.research.google.com.
Write code directly in cells and execute with
Shift+Enter.
Jupyter Notebook:
Install via
pip install jupyterlab.Launch with
jupyter laband create a new notebook.
Lab Setup Task (10 mins):
Open VS Code and run:
pythonCopy
print("Hello, Python!")Create a Colab notebook and execute the same code.
Last updated