Python Get Started

In this section, we will discuss Python programming basics knowledge, we will run a simple program to see the output on the console, and also see run your code in Jupiter Notebook

Python provides us the two ways to run a program:

Using Interactive interpreter prompt
Using a script file

please read the Python Introduction and installation in windows System

In our course, We have anaconda setup so we will run program in Jupyter notebook.

Interactive Mode Programming

In this case, no need to pass a script file as a parameter.
Python can be run as a command-line itself.

Type the following on the Windows, Mac or Linux command line:

C:\Users\infosyntax>python

Next we need to write print statement in our prompt. Please see the below piece of code.

print("Hello World!")

Interactive Mode Python
Interactive Mode

Script Mode Programming

The interpreter prompt is good for running a single-line statement of code. However, we cannot write the code every time on the terminal. Using script mode, we can write multiple lines of code to a file which can be executed later.

For this case, open an editor like notepad, create a file named and save it with .py extension. Next we need to execute the file in python.

Welcome.py
C:\Users\infosyntax\Work>python welcome.py
Run the application in CMD

Run Python Program in Jupyter Notebook

Jupyter Notebook is an open-source web application that we can use to create and share documents containing live code, equations, visualizations, and text.
The Jupyter Notebook is maintained by the people of the Jupyter Project.

Jupyter Notebook installation

We will install the jupyter notebook in our system then only can able to access jupyer notebook.

Please execute the below command in command prompt for installation.

pip install jupyter

Then just go to that location in your terminal and run the following command

C:\Users\infosyntax>jupyter notebook

This will start up Jupyter and your default browser should start (or open a new tab) to the following URL: http://localhost:8888/tree

Create notebook in jupyter notebook and save the file in your system. Finally we can write our code in jupyter notebook

print("Hello World!")

Next Please press shift key + Enter key then output will display on jupyter notebook

Please look into the bellow screenshot.

Python Program in Jupyter Notebook

Please download the sample program Click Here

Leave a Comment

Your email address will not be published. Required fields are marked *