First Python Programming Examples

First Python Program 

In this Section, we will examine the essential language structure of python by utilizing which, we will run a straightforward program to print "hello world" on the console. 

Python gives us the two different ways to run a program: 
  1. Using python command console
  2. Using Interactive interpreter prompt
  3. Using a script file

We should talk about every last one of them in detail. 

python command console

We can use python console window to execute python program.


the codes are highlighted by yellow color print() function is used to print string.  and second line is output line.

Interactive interpreter prompt (Shell)

Python gives us the element to execute the python explanation one by one at the intelligent incite. It is best for the situation where we are worried about the yield of each line of our python program. 

To open the intuitive mode, open the terminal (or order provoke) and type python (python3 on the off chance that on the off chance that you have python2 and python3 both introduced on your framework). 

It will open the accompanying brief where we can execute the python explanation and check their effect on the console.


Here, we get the message "Hello World !" printed

Using a script file

Interpreter prompt(Shell) is great to run the individual statement of the code. In any case, we can not compose the code each time on the terminal. 


We have to compose our code into a file which can be executed later. For this reason, open any code editor like notepad,notepad++, sublime, etc make a file named filename.py (python utilized .py expansion) and compose the accompanying code in it.

For creating a new file click on file menu of Interactive interpreter prompt (Shell) and select a new file and a new window will open and there you can write a program.


Output will display on Shell window.

First Python Programming Examples First Python Programming Examples Reviewed by Sk Jha on January 03, 2019 Rating: 5

No comments:

Powered by Blogger.