2.1  First Python program 

 

What is programming ?

Programming is given a set of instructions to a computer to follow using a language that the computer understand

Similar to an instruction that you give to another person using some language

What is Python 

An example set of instructions given to a person using English language





What is Python

  • Python is programming language
  1. that allows programmers to prepare instructions according to the rules of this language
  2. instructions are understood and executed by the computer with the help of python interpreter
  • Python interpreter is a software that reads python instructions(written in the python language) and perform them.
  • We use the python language by working with the Python interpreter.

Using Python

  • Two common ways the Python interpreter can be used are
  1. the interactive mode
  • gets a single Python line of code (statement) execute by the interpreter and displays the result
  • Python shell is known as REPL (Read, Evaluate, Print, Loop)
  1.        the scripting mode

  • create a Python py file containing many lines of code, execute the file 

 

     My first python program


                                      



Interactive mode



Scripting mode