First Steps in Python

Making your first steps in Python with simple print() operations.

#Hashtag and Run!

Let’s open our first Jupyter Notebook.

If you are working locally with the VS User Interface, navigate to the top menu and click on View > Command Palette. In the search bar that appears, type Create: New Jupyter Notebook and select it. VS Code will automatically create the first code block for you.

Now, try entering this line of code:

print('Welcome to Python')

To run the code block, simply click on the Run button (a small play icon) that appears above the code cell. If you are running the notebook for the first time, the interface will prompt you to select a Python interpreter.

Here, you need to choose either your local miniconda virtual environment or an online Python interpreter (Pyodide). After selecting the interpreter, click Run again to execute your code.

Using Comments in Python

You can add comments to your code to make it easier to understand for yourself and others. Python treats the hashtag character # in a special way: anything following a # on a line is ignored by the interpreter.

This makes hashtags very useful for adding explanations and annotations to your code. Comments are visible to you but do not affect the execution of the program.

# This is a comment. Comments help you understand your code later.
# Use them often to clarify what your code does.

print("Welcome to Python")
VS Code Overview

Updated: