INTRODUCTION
TO PYTHON
PROGRAMMING
Dr.M.Amsaprabhaa
Assistant Professor
Department of CSE
Shiv Nadar University
Chennai
What is Python?
Python is a very popular general-purpose
interpreted, interactive, object-oriented and high-
level programming language.
Python is dynamically-typed and garbage-collected
programming language.
It was created by Guido van Rossum during 1985-
1990.
Guido van Rossum
Compiling and Interpreting
Why should we use Python?
Python syntax allows programmers to express concepts in fewer lines of code.
Python is commonly used for developing websites and software, task automation,
data analysis, and data visualization.
Since it's relatively easy to learn, Python has been adopted by many non-
programmers such as accountants and scientists, for a variety of everyday tasks, like
organizing finances.
Top reasons to learn python
Data science
Scientific and mathematical computing
Web development
Finance and trading
System automation and administration
Computer graphics
Basic game development
Security and penetration testing
Top companies using python
 Dynamically-typed language means the type (for example- int, double, long, etc.) for a variable is
decided at run time not in advance because of this feature we don’t need to specify the type of variable.
 A garbage collection in Python manages the memory automatically. In simpler terms, the process of
automatic deletion of unwanted or unused objects to free the memory is called garbage collection in
Python.
Python Keywords
Programming Basics
An Integrated Development Environment (IDE) is software for building applications that combines
common developer tools into a single GUI.
Simple program
print("Welcome to the World of Python!")
text = "Welcome to the World of Python!"
print(text)
(Or)
 input() function is used to take input from the user.
Comments:
 Immutable is the when no change is possible over time. In
Python, if the value of an object cannot be changed over
time, then it is known as immutable. Once created, the value
of these objects is permanent.
 A tuple is a non-homogeneous data structure that can hold a
single row as well as several rows and columns.
 Dictionary is a non-homogeneous data structure that
contains key-value pairs. Tuples are represented by brackets
(). Dictionaries are represented by curly brackets {}.
OUTPUT
Selection
 Selection in Python is made using the two keywords ‘if’ and ‘elif’(elseif) and else
Functions
 Python used the keyword ‘def’ to define a function.
Syntax:
def function-name(arguments):
#function body
 As the name suggests it calls repeating things again and again.
Iteration/Looping
Module
 ‘import’ keyword is used to import a particular module into the python code.
print("Create a Password: ")
cp = input()
print("nEnter Two Numbers to Add: ")
numOne = int(input())
numTwo = int(input())
print("nEnter Password to Display the Result: ")
ep = input()
if cp == ep:
sum = numOne + numTwo
print("nResult = ", sum)
else:
print("nWrong Password!")
SIMPLE PROGRAM
REFERENCES

INTRODUCTION TO PYTHON PROGRAMMING .pptx

  • 1.
  • 3.
    What is Python? Pythonis a very popular general-purpose interpreted, interactive, object-oriented and high- level programming language. Python is dynamically-typed and garbage-collected programming language. It was created by Guido van Rossum during 1985- 1990. Guido van Rossum
  • 4.
  • 6.
    Why should weuse Python? Python syntax allows programmers to express concepts in fewer lines of code. Python is commonly used for developing websites and software, task automation, data analysis, and data visualization. Since it's relatively easy to learn, Python has been adopted by many non- programmers such as accountants and scientists, for a variety of everyday tasks, like organizing finances.
  • 7.
    Top reasons tolearn python Data science Scientific and mathematical computing Web development Finance and trading System automation and administration Computer graphics Basic game development Security and penetration testing
  • 8.
  • 10.
     Dynamically-typed languagemeans the type (for example- int, double, long, etc.) for a variable is decided at run time not in advance because of this feature we don’t need to specify the type of variable.  A garbage collection in Python manages the memory automatically. In simpler terms, the process of automatic deletion of unwanted or unused objects to free the memory is called garbage collection in Python.
  • 11.
  • 12.
  • 13.
    An Integrated DevelopmentEnvironment (IDE) is software for building applications that combines common developer tools into a single GUI.
  • 15.
    Simple program print("Welcome tothe World of Python!") text = "Welcome to the World of Python!" print(text) (Or)
  • 16.
     input() functionis used to take input from the user.
  • 17.
  • 18.
     Immutable isthe when no change is possible over time. In Python, if the value of an object cannot be changed over time, then it is known as immutable. Once created, the value of these objects is permanent.  A tuple is a non-homogeneous data structure that can hold a single row as well as several rows and columns.  Dictionary is a non-homogeneous data structure that contains key-value pairs. Tuples are represented by brackets (). Dictionaries are represented by curly brackets {}.
  • 19.
  • 20.
    Selection  Selection inPython is made using the two keywords ‘if’ and ‘elif’(elseif) and else
  • 21.
    Functions  Python usedthe keyword ‘def’ to define a function. Syntax: def function-name(arguments): #function body
  • 22.
     As thename suggests it calls repeating things again and again. Iteration/Looping
  • 23.
    Module  ‘import’ keywordis used to import a particular module into the python code.
  • 24.
    print("Create a Password:") cp = input() print("nEnter Two Numbers to Add: ") numOne = int(input()) numTwo = int(input()) print("nEnter Password to Display the Result: ") ep = input() if cp == ep: sum = numOne + numTwo print("nResult = ", sum) else: print("nWrong Password!") SIMPLE PROGRAM
  • 25.