First Python Program (Interactive Mode)

In the previous lesson, we learned how to install Python. In this lesson, we will learn how to begin with Python and how to run first Python program with the Interactive Mode method. It’s easy to run a Python program.

Python 3 Syntax

As a demo program, we will learn how to print a text in Python 3. For this, print function is used, which outputs to the console window.

Go to command prompt and type the following, and press enter,

Here’s the output,

Python First Program output

Python 2 Syntax

In Python 2, you need to type the following.

The parentheses are not necessary,

In this lesson we learned how to run our first Python program. We also saw the syntax for Python 3 as well as Python 2 programs. In the next lesson, we will see how to work with scriptmode method to run Python 3 programs.

Python 3 Installation
First Python Program (Script Mode)
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading