SlideShare a Scribd company logo
Python
Keep calm it’s python
Below are some facts about Python.
> Python is a widely used general-purpose, high
level programming language.
> Python allows programming in Object Oriented
and Procedural paradigms.
> Python programs generally are smaller than other
programming languages like Java.
> Programmers have to type relatively less and
identation requirement of the language, makes them
readable all the time.
The biggest strength of the Python is large
libarary which can be used for the following
• Machine Learning
• GUI Applications
• Web frameworks like Django (used by YouTube)
• Multimedia
• Image processing
• Test frameworks
• Web scraping
• Scientific computing
• Text processing and many more..
Python Language Introduction
• Python is a widely used general-purpose, high level
programming language. It was initially designed by Guido
van Rossum in 1991 and developed by Python Software
Foundation. It was mainly developed for emphasis on code
readability, and its syntax allows programmers to express
concepts in fewer lines of code.
There are two major Python versions- Python 2
and Python 3. Both are quite different.
• 1) Finding an Interpreter:
• Before we start Python programming, we need to have an interpreter
to interpret and run our programs. There are certain online
interpreters like http://ideone.com/ or http://codepad.org/ that can
be used to start Python without installing an interpreter
• Windows: There are many interpreters available freely to run Python
scripts like IDLE ( Integrated Development Environment ) which is
installed when you install the python software
from http://python.org/
• Linux: For Linux, Python comes bundled with the linux.
Writing first program:
• print(“Hello world my name is piyush rai”)
• We can comment python using #
DATA STRUCTURE AND PYTHON
• In other programming languages like C, C++ and Java,
you will need to declare the type of variables but in
Python you don’t need to do that.
• Just type in the variable and when values will be
given to it, then it will automatically know whether
the value given would be a int, float or char or even a
String.
LIST
• Is the most basic Data Structure in python. List is
mutable data structure i.e items can be added to list
later after the list creation.
• Its like you are going to shop at local market and
made a list of some items and later on you can add
more and more items to the list.
Input and Output
•Now, we will learn how to take input from
the user and hence manipulate it or simply
display it.
•input() function is used to take input from
the user.
Selection
• Selection in Python is made using the two keywords ‘if’
• and
• ‘elif’ and
• else (elseif)
Functions
•You can think of functions like a bunch of
code that is intended to do a particular task
in the whole Python script.
• Python used the keyword ‘def’ to define a
function.
• Now as we know any program starts from a ‘main’
function…lets create a main function like in many other
programming languages.
Iteration Looping
•As the name suggests it calls repeating
things again and again. We will use the most
popular ‘for’ loop here.
Modules
• Python has a very rich module library that has several
functions to do many tasks. You can read more about
Python’s standard library on python.org
• ‘import’ keyword is used to import a particular
module into your python code. For instance consider
the following program.
Python vs Java
Python Java
Dynamically Typed1.No need to declare
anything. An assignment statement binds a
name to an object, and the object can be of
any type.2.No type casting required when
using container objects
Statically Typed 1.All variable names (along
with their types) must be explicitly declared.
Attempting to assign an object of the wrong
type to a variable name triggers a type
exception.2.Type casting is required when
using container objects.
Concise Express much in limited
words
Verbose Contains more words
Compact Less Compact
Uses Indentation for structuring code Uses braces for structuring code
Important differences between Python 2.x
and Python 3.x with examples
• Division operator
• print function
• Unicode
• xrange
• Error Handling
• _future_ module
Keywords in Python
• Python Keywords – Introduction
• This article aims at providing a detailed insight to these
keywords.
• 1. True : This keyword is used to represent a boolean
true. If a statement is true, “True” is printed.
• 2. False : This keyword is used to represent a boolean
false. If a statement is false, “False” is printed.
True and False in python are same as 1 and 0.
Example:
3. None : This is a special constant used to denote a null
value or a void. Its important to remember, 0, any empty
container(e.g empty list) do not compute to None.
It is an object of its own datatype – NoneType. It is not
possible to create multiple None objects and can assign it to
variables.
4. and : This a logical operator in python. “and” Return the
first false value .if not found return last. The truth table for
“and” is depicted below.
5. or : This a logical operator in python. “or” Return
the first True value.if not found return last.The truth
table for “or” is depicted below
6. not : This logical operator inverts the truth
value. The truth table for “not” is depicted
below.
More About input in python
• We can also type cast this input to integer, float or string by
specifying the input() function inside the type.
• Typecasting the input to Integer: There might be conditions
when you might require integer input from user/Console,
the following code takes two input(integer/float) from
console and typecasts them to integer then prints the sum.
• Typecasting the input to Float: To convert the input to float
the following code will work out.
• Typecasting the input to String: All kind of input can be
converted to string type whether they are float or integer.
We make use of keyword str for typecasting.
Taking multiple inputs from user
in Python

More Related Content

What's hot (20)

PPTX
Programming
monishagoyal4
 
DOCX
Seminar report on python 3 course
HimanshuPanwar38
 
PPTX
Introduction to-python
Aakashdata
 
PDF
Python quick guide1
Kanchilug
 
DOCX
Seminar report On Python
Shivam Gupta
 
PDF
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
EditorIJAERD
 
PPTX
Best Python Online Training with Live Project by Expert
QA TrainingHub
 
PDF
Python Intro
Tim Penhey
 
PPT
Python Programming ppt
ismailmrribi
 
PDF
Intro to Python for Non-Programmers
Ahmad Alhour
 
PDF
Python Workshop
Saket Choudhary
 
PPT
Intro to Python
primeteacher32
 
PDF
Python tutorial
Vijay Chaitanya
 
PPTX
Beginning Python Programming
St. Petersburg College
 
PPTX
Python - An Introduction
Swarit Wadhe
 
PPTX
Python Tutorial Part 2
Haitham El-Ghareeb
 
PPTX
Python and its Applications
Abhijeet Singh
 
PDF
summer training report on python
Shubham Yadav
 
PDF
Python Crash Course
Haim Michael
 
PDF
Python final ppt
Ripal Ranpara
 
Programming
monishagoyal4
 
Seminar report on python 3 course
HimanshuPanwar38
 
Introduction to-python
Aakashdata
 
Python quick guide1
Kanchilug
 
Seminar report On Python
Shivam Gupta
 
PYTHON CURRENT TREND APPLICATIONS- AN OVERVIEW
EditorIJAERD
 
Best Python Online Training with Live Project by Expert
QA TrainingHub
 
Python Intro
Tim Penhey
 
Python Programming ppt
ismailmrribi
 
Intro to Python for Non-Programmers
Ahmad Alhour
 
Python Workshop
Saket Choudhary
 
Intro to Python
primeteacher32
 
Python tutorial
Vijay Chaitanya
 
Beginning Python Programming
St. Petersburg College
 
Python - An Introduction
Swarit Wadhe
 
Python Tutorial Part 2
Haitham El-Ghareeb
 
Python and its Applications
Abhijeet Singh
 
summer training report on python
Shubham Yadav
 
Python Crash Course
Haim Michael
 
Python final ppt
Ripal Ranpara
 

Similar to Python intro (20)

PPTX
Introduction to Programming.pptx ok ok ok
846Sarthakpandey
 
PDF
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
PPTX
python presntation 2.pptx
Arpittripathi45
 
PDF
Tutorial on-python-programming
Chetan Giridhar
 
PPTX
Python Introduction
Punithavel Ramani
 
PDF
How To Tame Python
Mohd Anwar Jamal Faiz
 
PPTX
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
PPT
Python - Module 1.ppt
jaba kumar
 
PPTX
cupdf.com_python-seminar-ppt.pptx.........
ansuljoshi8456
 
PPTX
Python basics
ssuser4e32df
 
PDF
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
rajkumar2792005
 
PPTX
Introduction to Python Programming Language
merlinjohnsy
 
PPTX
Python
Shivam Gupta
 
PDF
python-160403194316.pdf
gmadhu8
 
PPTX
Introduction to Python for Data Science and Machine Learning
ParrotAI
 
PPTX
Introduction to python programming ( part-1)
Ziyauddin Shaik
 
PPTX
introduction to python programming concepts
GautamDharamrajChouh
 
PPTX
INTRODUCTION TO PYTHON.pptx
Nimrahafzal1
 
PPTX
2. Getting Started with Python second lesson .pptx
Primary2Primary2
 
Introduction to Programming.pptx ok ok ok
846Sarthakpandey
 
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
python presntation 2.pptx
Arpittripathi45
 
Tutorial on-python-programming
Chetan Giridhar
 
Python Introduction
Punithavel Ramani
 
How To Tame Python
Mohd Anwar Jamal Faiz
 
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
Python - Module 1.ppt
jaba kumar
 
cupdf.com_python-seminar-ppt.pptx.........
ansuljoshi8456
 
Python basics
ssuser4e32df
 
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
rajkumar2792005
 
Introduction to Python Programming Language
merlinjohnsy
 
Python
Shivam Gupta
 
python-160403194316.pdf
gmadhu8
 
Introduction to Python for Data Science and Machine Learning
ParrotAI
 
Introduction to python programming ( part-1)
Ziyauddin Shaik
 
introduction to python programming concepts
GautamDharamrajChouh
 
INTRODUCTION TO PYTHON.pptx
Nimrahafzal1
 
2. Getting Started with Python second lesson .pptx
Primary2Primary2
 
Ad

Recently uploaded (20)

PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Ad

Python intro

  • 2. Below are some facts about Python. > Python is a widely used general-purpose, high level programming language. > Python allows programming in Object Oriented and Procedural paradigms. > Python programs generally are smaller than other programming languages like Java. > Programmers have to type relatively less and identation requirement of the language, makes them readable all the time.
  • 3. The biggest strength of the Python is large libarary which can be used for the following • Machine Learning • GUI Applications • Web frameworks like Django (used by YouTube) • Multimedia • Image processing • Test frameworks • Web scraping • Scientific computing • Text processing and many more..
  • 4. Python Language Introduction • Python is a widely used general-purpose, high level programming language. It was initially designed by Guido van Rossum in 1991 and developed by Python Software Foundation. It was mainly developed for emphasis on code readability, and its syntax allows programmers to express concepts in fewer lines of code.
  • 5. There are two major Python versions- Python 2 and Python 3. Both are quite different. • 1) Finding an Interpreter: • Before we start Python programming, we need to have an interpreter to interpret and run our programs. There are certain online interpreters like http://ideone.com/ or http://codepad.org/ that can be used to start Python without installing an interpreter • Windows: There are many interpreters available freely to run Python scripts like IDLE ( Integrated Development Environment ) which is installed when you install the python software from http://python.org/ • Linux: For Linux, Python comes bundled with the linux.
  • 6. Writing first program: • print(“Hello world my name is piyush rai”) • We can comment python using #
  • 7. DATA STRUCTURE AND PYTHON • In other programming languages like C, C++ and Java, you will need to declare the type of variables but in Python you don’t need to do that. • Just type in the variable and when values will be given to it, then it will automatically know whether the value given would be a int, float or char or even a String.
  • 8. LIST • Is the most basic Data Structure in python. List is mutable data structure i.e items can be added to list later after the list creation. • Its like you are going to shop at local market and made a list of some items and later on you can add more and more items to the list.
  • 9. Input and Output •Now, we will learn how to take input from the user and hence manipulate it or simply display it. •input() function is used to take input from the user.
  • 10. Selection • Selection in Python is made using the two keywords ‘if’ • and • ‘elif’ and • else (elseif)
  • 11. Functions •You can think of functions like a bunch of code that is intended to do a particular task in the whole Python script. • Python used the keyword ‘def’ to define a function. • Now as we know any program starts from a ‘main’ function…lets create a main function like in many other programming languages.
  • 12. Iteration Looping •As the name suggests it calls repeating things again and again. We will use the most popular ‘for’ loop here.
  • 13. Modules • Python has a very rich module library that has several functions to do many tasks. You can read more about Python’s standard library on python.org • ‘import’ keyword is used to import a particular module into your python code. For instance consider the following program.
  • 14. Python vs Java Python Java Dynamically Typed1.No need to declare anything. An assignment statement binds a name to an object, and the object can be of any type.2.No type casting required when using container objects Statically Typed 1.All variable names (along with their types) must be explicitly declared. Attempting to assign an object of the wrong type to a variable name triggers a type exception.2.Type casting is required when using container objects. Concise Express much in limited words Verbose Contains more words Compact Less Compact Uses Indentation for structuring code Uses braces for structuring code
  • 15. Important differences between Python 2.x and Python 3.x with examples • Division operator • print function • Unicode • xrange • Error Handling • _future_ module
  • 16. Keywords in Python • Python Keywords – Introduction • This article aims at providing a detailed insight to these keywords. • 1. True : This keyword is used to represent a boolean true. If a statement is true, “True” is printed. • 2. False : This keyword is used to represent a boolean false. If a statement is false, “False” is printed. True and False in python are same as 1 and 0. Example:
  • 17. 3. None : This is a special constant used to denote a null value or a void. Its important to remember, 0, any empty container(e.g empty list) do not compute to None. It is an object of its own datatype – NoneType. It is not possible to create multiple None objects and can assign it to variables. 4. and : This a logical operator in python. “and” Return the first false value .if not found return last. The truth table for “and” is depicted below.
  • 18. 5. or : This a logical operator in python. “or” Return the first True value.if not found return last.The truth table for “or” is depicted below 6. not : This logical operator inverts the truth value. The truth table for “not” is depicted below.
  • 19. More About input in python • We can also type cast this input to integer, float or string by specifying the input() function inside the type. • Typecasting the input to Integer: There might be conditions when you might require integer input from user/Console, the following code takes two input(integer/float) from console and typecasts them to integer then prints the sum. • Typecasting the input to Float: To convert the input to float the following code will work out. • Typecasting the input to String: All kind of input can be converted to string type whether they are float or integer. We make use of keyword str for typecasting.
  • 20. Taking multiple inputs from user in Python