SlideShare a Scribd company logo
Online Presentation on
Learn Python: Python for
beginners
Presented by
Prof. DharmeshTank
CE / IT Department
09-May-2020
Outline
 What and Why Python?
 Installation of Python
 Editors used for Python
 Variable declaration, Numbers & Data types
 Operators, String, List,Tuples, Dictionary
 Conditional Statements
 Looping Statements
 Application of Python language
 Conclusion
What is
Python?
Python is an interpreted, object-
oriented, high-level programming
language with dynamic semantics.
Source: https://www.python.org/
Why Python?
 It is portable, expandable, and embeddable.
 It can easily managing and organizing complex data.
 It’s syntax are clean.
 Python is the language of choice for the Machine Learning,
AI, Data Science, Raspberry Pi.
 Python offers tools that streamline the IoT development
process, such as webrepl.
 Since Python is an interpreted language, you can easily
test your solution without compiling the code or flashing
the device.
Features of
Python
Source: https://www.data-flair.training%2Fblogs%2Ffeatures-of-python%2F&psig=AOvVaw 2UNLNd8CUxNHuaHfuDj_-
s&ust=1589017513177810
Installation of
Python
Source: https://www.python.org/downloads/
EditorsUsed
for Python
 Python IDLE
 SublimeText
 Atom
 Jupiter
 PyDev
 Anaconda
 PyCharm
 Spyder
 Visual Studio IDE
 Vi /Vim (Used in Linux)
 Thonny (Used in Linux)
Source: www.datacamp.com%2Fcommunity%2Ftutorials%2Ftop-python-ides-for-2019&psig=AOvVaw0bp2ioDTCGM
Variable
declaration &
Data types
• What are the different data types in Python ?
In Python, data types are broadly classified into the
following:
1. Numbers
2. List
3.Tuple
4. Strings
5. Dictionary
• How to define a variable?
Syntax: VariableName = value
Example: phoneNo = 12345
Marks = 85.45
• How to comments?
Syntax: #variableName = value
Example: >>> # a=10
Operators
1. Assignment Operator (‘=‘)
2. Arithmetic Operators
 Multiplication (‘*’)
 Division (‘/‘)
 Addition (‘+’)
 Subtraction (‘-‘)
 Modulo (‘%’)
3. Relational or Comparison Operators
 Equal to (‘==‘) , Greater than (‘>’), Lesser than (‘<‘) ,
Greater than or equal to (‘>=’) , Lesser than or equal to
(‘<=‘), Not equal to (!=)
4. Logical Operators
 and -> Example: ((5 > 3) and (3 < 5)) True
 or -> Example: ((5 < 3) or (3 < 5)) True
 not -> Example: not (5<3) returnsTrue (reverse of
False).
Implementation
String
 How to define a string ?
Syntax :
stringName = “string”or stringName = ‘string’
Example:
programmingLanguage = “Python”
or
programmingLanguage = ‘Python’
 The starting index of any string is zero.
Implementation
ofString in
Python
String In-built
function
 upper() -
Syntax : stringName.upper()
 lower() -
Syntax : stringName.lower()
 replace() -
Syntax: stringName.replace(“Old Str”, “New Str”)
 length -
Syntax: len(stringName)
Implementation
ofString
Function in
Python
List
 A list is a container that holds many objects under a
single name.
Syntax : listName = [object1, object2, object3]
Example: fruit = [‘Apple', ‘Mango', ‘Orange’]
 It is same as array in C, C++ or JAVA.
 To access the list :
Example : fruit[0] = Apple, fruit[1] = Mango,
fruit[2] = Orange
ListOperations
 append() - To append any value in list
Syntax : list.append(element)
 insert() - To Insert at specific place in list
Syntax : list.insert(index, element)
 remove() - To remove the element from list
Syntax: list.remove(element)
 sort -To sort the list in ascending order
Syntax: list.sort()
 reverse -To reverse the list
Syntax: list.reverse()
 pop -To delete the specific index value
Syntax: list.pop(index)
Implementation
of List
Functions
Tuples
• A tuple is a container that holds many objects under a single
name.
• A tuple is immutable which means, a tuple once defined
cannot be modified.
Syntax : tupleName = (object1, object2, object3)
Example: ImpDate = (“11-09-1989”, “13-2-2020”)
• To access the values in a tuple
>>> ImpDate[1]
>>>13-2-2020
• To delete a tuple
Syntax: del(tupleName)
Example: del(ImpDate)
Dictionary
• A dictionary is a set of key-value pairs referenced by a
single name.
Syntax : dictionaryName = {“keyOne” : “valueOne”,
“keyTwo”: “valueTwo”}
Example:>>> colorOfFruits = {“apple”: “red”,
“mango”: “yellow”, “orange”: “orange”}
• To Retrieve the value of dictionary
Syntax: dictionaryName[“key”]
Example: >>>colorOfFruits[“mango”]
>>>yellow
Dictionary
inbuilt
Functions
 List all keys : keys() is used to list all the keys in a dictionary.
Syntax: dictionaryName.keys()
 List all values : values() is used to list all the values in a dictionary
Syntax: dictionaryName.values()
 Delete a key-value pair : del keyword is used to delete a key-
value pair from a dictionary
Syntax: del dictionaryName[“key”]
 Copy a dictionary into another : is used to copy the contents of
one dictionary to another
Syntax: dictionaryTwo = dictionaryOne.copy()
 Clear a dictionary: is used to clear the contents of a dictionary
and make it empty .
Implementation
of Dictionary &
It’s Functions
 Condition statements are a block of
statements whose execution depends on a
certain condition.
 Indentation play a very important role over
here.
 Different type of condition statements:
1. If statement
2. If-else statement
3. If-elif-else statement
4. Nested if
Control
Statement
(Condition)
Implementation
ofCondition
Statement
1. If statement
2. If-else statement
Indentation
Continue…. 4. Nested if statement
3. If-elif-else statement
 Loop statements : Looping is used to repeatedly
perform a block of statements over and over again.
 Different type of loop statements:
1. For loop
2. While loop
Control
Statement
(Loop)
1. For loop
statement
• The number of iterations to
be performed depends upon
the length of the list
• Syntax:
for count in list:
statement 1
statement 2…
statement n
• Here count is a iterative
variable who’s value start
from first value of the list .
• And, list is the array in
python.
• end = ‘ ’ is used to end the
print statement with a
white space instead of a
new line.
2.While loop
statement
• It repeatedly execute a
block of statements as long
as the condition mentioned
holds true.
Syntax:
while condition:
statement 1
statement 2…
statement n
• Here condition is used to
control the statement.
• while True: statement used
for infinite no of iteration.
Additional
Statement
 Break: A break
statement is used to
stop a loop from
further execution.
 Example:
>>>len=1
>>>while len>0:
if len == 3:
break
print(len)
len=len+1
 Else:The block of
statements in the else
block gets executed if
the break statement
in the looping
condition was
executed.
 Example:
>>> len=1
>>>while len<=3:
if len ==5:
break
print(len)
len=len+1
else:
print(“Break
statement was
executed”)
 Continue: Continue
statement is used to
skip a particular
iteration of the loop.
 Example:
>>> len = 1
>>>while len<=4:
if len ==2:
len=len+1
continue
print(len)
len=len+1
Application of
Python
Source: https://www.fiverr.com/
Real world
Application of
Python
 BitTorrent is made up in Python
 Web and Internet Development
 Scientific and Numeric: SciPy, Pandas, Ipython
 Business Applications : Odoo, Tryton
Source: topdevelopers.co%2Fblog%2F10-reasons-to-choose-python-web-development-project%2F&psig=AOvVaw
2drpI11_4MB70 UCf_c7W0S&ust=1589011542035214
Thank you
&
Suggestions or
Any Questions

More Related Content

What's hot (20)

PPTX
Function in C program
Nurul Zakiah Zamri Tan
 
PPTX
Pointers in C Programming
Jasleen Kaur (Chandigarh University)
 
PPTX
Java basics and java variables
Pushpendra Tyagi
 
PDF
Control statements
Kanwalpreet Kaur
 
PPTX
Object oriented programming with python
Arslan Arshad
 
PPTX
Pointers in c++
Vineeta Garg
 
PDF
itft-Decision making and branching in java
Atul Sehdev
 
PPTX
Java Decision Control
Jayfee Ramos
 
PDF
Object Oriented Paradigm
Hüseyin Ergin
 
PDF
Python If Else | If Else Statement In Python | Edureka
Edureka!
 
PPTX
Type conversion
PreethaPreetha5
 
PPT
Graphics and Java 2D
Andy Juan Sarango Veliz
 
PPTX
Python Functions
Mohammed Sikander
 
PPT
Operator Overloading
Nilesh Dalvi
 
PPT
Oop Presentation
Ghaffar Khan
 
PPTX
Object oriented programming in python
nitamhaske
 
PPTX
Variables and Data Types
Infoviaan Technologies
 
PPTX
Functions in C
Kamal Acharya
 
PPT
Module4 lex and yacc.ppt
ProddaturNagaVenkata
 
PPTX
JAVA Literals
ASHUTOSH TRIVEDI
 
Function in C program
Nurul Zakiah Zamri Tan
 
Pointers in C Programming
Jasleen Kaur (Chandigarh University)
 
Java basics and java variables
Pushpendra Tyagi
 
Control statements
Kanwalpreet Kaur
 
Object oriented programming with python
Arslan Arshad
 
Pointers in c++
Vineeta Garg
 
itft-Decision making and branching in java
Atul Sehdev
 
Java Decision Control
Jayfee Ramos
 
Object Oriented Paradigm
Hüseyin Ergin
 
Python If Else | If Else Statement In Python | Edureka
Edureka!
 
Type conversion
PreethaPreetha5
 
Graphics and Java 2D
Andy Juan Sarango Veliz
 
Python Functions
Mohammed Sikander
 
Operator Overloading
Nilesh Dalvi
 
Oop Presentation
Ghaffar Khan
 
Object oriented programming in python
nitamhaske
 
Variables and Data Types
Infoviaan Technologies
 
Functions in C
Kamal Acharya
 
Module4 lex and yacc.ppt
ProddaturNagaVenkata
 
JAVA Literals
ASHUTOSH TRIVEDI
 

Similar to Basic of Python- Hands on Session (20)

PPTX
FUNDAMENTALS OF PYTHON LANGUAGE
Saraswathi Murugan
 
PPTX
Pythonppt28 11-18
Saraswathi Murugan
 
PPTX
Programming Basics.pptx
mahendranaik18
 
PPTX
python presentation.pptx
NightTune44
 
PPTX
Python introduction
leela rani
 
PPTX
Python ppt_118.pptx
MadhuriAnaparthy
 
PPTX
Programming in Python
Tiji Thomas
 
PDF
Python indroduction
FEG
 
PPTX
Python-The programming Language
Rohan Gupta
 
PDF
Python: An introduction A summer workshop
ForrayFerenc
 
PDF
Pythonintro
Hardik Malhotra
 
PPTX
python_computer engineering_semester_computer_language.pptx
MadhusmitaSahu40
 
PPTX
Introduction to Python for Data Science and Machine Learning
ParrotAI
 
PPTX
Python_IoT.pptx
SwatiChoudhary95
 
PPT
Python tutorialfeb152012
Shani729
 
PPTX
Python For Data Science.pptx
rohithprabhas1
 
PPT
PPT3-CONDITIONAL STATEMENT LOOPS DICTIONARY FUNCTIONS.ppt
RahulKumar812056
 
PPTX
Python chapter presentation details.pptx
linatalole2001
 
PPT
Unit 2 python
praveena p
 
PPTX
1664611760basics-of-python-for begainer1 (3).pptx
krsonupandey92
 
FUNDAMENTALS OF PYTHON LANGUAGE
Saraswathi Murugan
 
Pythonppt28 11-18
Saraswathi Murugan
 
Programming Basics.pptx
mahendranaik18
 
python presentation.pptx
NightTune44
 
Python introduction
leela rani
 
Python ppt_118.pptx
MadhuriAnaparthy
 
Programming in Python
Tiji Thomas
 
Python indroduction
FEG
 
Python-The programming Language
Rohan Gupta
 
Python: An introduction A summer workshop
ForrayFerenc
 
Pythonintro
Hardik Malhotra
 
python_computer engineering_semester_computer_language.pptx
MadhusmitaSahu40
 
Introduction to Python for Data Science and Machine Learning
ParrotAI
 
Python_IoT.pptx
SwatiChoudhary95
 
Python tutorialfeb152012
Shani729
 
Python For Data Science.pptx
rohithprabhas1
 
PPT3-CONDITIONAL STATEMENT LOOPS DICTIONARY FUNCTIONS.ppt
RahulKumar812056
 
Python chapter presentation details.pptx
linatalole2001
 
Unit 2 python
praveena p
 
1664611760basics-of-python-for begainer1 (3).pptx
krsonupandey92
 
Ad

More from Dharmesh Tank (6)

PPTX
Seminar on MATLAB
Dharmesh Tank
 
PPTX
Goal Recognition in Soccer Match
Dharmesh Tank
 
PPTX
Face recognization using artificial nerual network
Dharmesh Tank
 
PPTX
Graph problem & lp formulation
Dharmesh Tank
 
PPTX
A Big Data Concept
Dharmesh Tank
 
PPTX
FIne Grain Multithreading
Dharmesh Tank
 
Seminar on MATLAB
Dharmesh Tank
 
Goal Recognition in Soccer Match
Dharmesh Tank
 
Face recognization using artificial nerual network
Dharmesh Tank
 
Graph problem & lp formulation
Dharmesh Tank
 
A Big Data Concept
Dharmesh Tank
 
FIne Grain Multithreading
Dharmesh Tank
 
Ad

Recently uploaded (20)

PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PPTX
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PPTX
Presentation 2.pptx AI-powered home security systems Secure-by-design IoT fr...
SoundaryaBC2
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PDF
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
PPTX
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
PPTX
Big Data and Data Science hype .pptx
SUNEEL37
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Presentation 2.pptx AI-powered home security systems Secure-by-design IoT fr...
SoundaryaBC2
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
Thermal runway and thermal stability.pptx
godow93766
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
Big Data and Data Science hype .pptx
SUNEEL37
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 

Basic of Python- Hands on Session

  • 1. Online Presentation on Learn Python: Python for beginners Presented by Prof. DharmeshTank CE / IT Department 09-May-2020
  • 2. Outline  What and Why Python?  Installation of Python  Editors used for Python  Variable declaration, Numbers & Data types  Operators, String, List,Tuples, Dictionary  Conditional Statements  Looping Statements  Application of Python language  Conclusion
  • 3. What is Python? Python is an interpreted, object- oriented, high-level programming language with dynamic semantics. Source: https://www.python.org/
  • 4. Why Python?  It is portable, expandable, and embeddable.  It can easily managing and organizing complex data.  It’s syntax are clean.  Python is the language of choice for the Machine Learning, AI, Data Science, Raspberry Pi.  Python offers tools that streamline the IoT development process, such as webrepl.  Since Python is an interpreted language, you can easily test your solution without compiling the code or flashing the device.
  • 7. EditorsUsed for Python  Python IDLE  SublimeText  Atom  Jupiter  PyDev  Anaconda  PyCharm  Spyder  Visual Studio IDE  Vi /Vim (Used in Linux)  Thonny (Used in Linux) Source: www.datacamp.com%2Fcommunity%2Ftutorials%2Ftop-python-ides-for-2019&psig=AOvVaw0bp2ioDTCGM
  • 8. Variable declaration & Data types • What are the different data types in Python ? In Python, data types are broadly classified into the following: 1. Numbers 2. List 3.Tuple 4. Strings 5. Dictionary • How to define a variable? Syntax: VariableName = value Example: phoneNo = 12345 Marks = 85.45 • How to comments? Syntax: #variableName = value Example: >>> # a=10
  • 9. Operators 1. Assignment Operator (‘=‘) 2. Arithmetic Operators  Multiplication (‘*’)  Division (‘/‘)  Addition (‘+’)  Subtraction (‘-‘)  Modulo (‘%’) 3. Relational or Comparison Operators  Equal to (‘==‘) , Greater than (‘>’), Lesser than (‘<‘) , Greater than or equal to (‘>=’) , Lesser than or equal to (‘<=‘), Not equal to (!=) 4. Logical Operators  and -> Example: ((5 > 3) and (3 < 5)) True  or -> Example: ((5 < 3) or (3 < 5)) True  not -> Example: not (5<3) returnsTrue (reverse of False).
  • 11. String  How to define a string ? Syntax : stringName = “string”or stringName = ‘string’ Example: programmingLanguage = “Python” or programmingLanguage = ‘Python’  The starting index of any string is zero.
  • 13. String In-built function  upper() - Syntax : stringName.upper()  lower() - Syntax : stringName.lower()  replace() - Syntax: stringName.replace(“Old Str”, “New Str”)  length - Syntax: len(stringName)
  • 15. List  A list is a container that holds many objects under a single name. Syntax : listName = [object1, object2, object3] Example: fruit = [‘Apple', ‘Mango', ‘Orange’]  It is same as array in C, C++ or JAVA.  To access the list : Example : fruit[0] = Apple, fruit[1] = Mango, fruit[2] = Orange
  • 16. ListOperations  append() - To append any value in list Syntax : list.append(element)  insert() - To Insert at specific place in list Syntax : list.insert(index, element)  remove() - To remove the element from list Syntax: list.remove(element)  sort -To sort the list in ascending order Syntax: list.sort()  reverse -To reverse the list Syntax: list.reverse()  pop -To delete the specific index value Syntax: list.pop(index)
  • 18. Tuples • A tuple is a container that holds many objects under a single name. • A tuple is immutable which means, a tuple once defined cannot be modified. Syntax : tupleName = (object1, object2, object3) Example: ImpDate = (“11-09-1989”, “13-2-2020”) • To access the values in a tuple >>> ImpDate[1] >>>13-2-2020 • To delete a tuple Syntax: del(tupleName) Example: del(ImpDate)
  • 19. Dictionary • A dictionary is a set of key-value pairs referenced by a single name. Syntax : dictionaryName = {“keyOne” : “valueOne”, “keyTwo”: “valueTwo”} Example:>>> colorOfFruits = {“apple”: “red”, “mango”: “yellow”, “orange”: “orange”} • To Retrieve the value of dictionary Syntax: dictionaryName[“key”] Example: >>>colorOfFruits[“mango”] >>>yellow
  • 20. Dictionary inbuilt Functions  List all keys : keys() is used to list all the keys in a dictionary. Syntax: dictionaryName.keys()  List all values : values() is used to list all the values in a dictionary Syntax: dictionaryName.values()  Delete a key-value pair : del keyword is used to delete a key- value pair from a dictionary Syntax: del dictionaryName[“key”]  Copy a dictionary into another : is used to copy the contents of one dictionary to another Syntax: dictionaryTwo = dictionaryOne.copy()  Clear a dictionary: is used to clear the contents of a dictionary and make it empty .
  • 22.  Condition statements are a block of statements whose execution depends on a certain condition.  Indentation play a very important role over here.  Different type of condition statements: 1. If statement 2. If-else statement 3. If-elif-else statement 4. Nested if Control Statement (Condition)
  • 24. Continue…. 4. Nested if statement 3. If-elif-else statement
  • 25.  Loop statements : Looping is used to repeatedly perform a block of statements over and over again.  Different type of loop statements: 1. For loop 2. While loop Control Statement (Loop)
  • 26. 1. For loop statement • The number of iterations to be performed depends upon the length of the list • Syntax: for count in list: statement 1 statement 2… statement n • Here count is a iterative variable who’s value start from first value of the list . • And, list is the array in python. • end = ‘ ’ is used to end the print statement with a white space instead of a new line.
  • 27. 2.While loop statement • It repeatedly execute a block of statements as long as the condition mentioned holds true. Syntax: while condition: statement 1 statement 2… statement n • Here condition is used to control the statement. • while True: statement used for infinite no of iteration.
  • 28. Additional Statement  Break: A break statement is used to stop a loop from further execution.  Example: >>>len=1 >>>while len>0: if len == 3: break print(len) len=len+1  Else:The block of statements in the else block gets executed if the break statement in the looping condition was executed.  Example: >>> len=1 >>>while len<=3: if len ==5: break print(len) len=len+1 else: print(“Break statement was executed”)  Continue: Continue statement is used to skip a particular iteration of the loop.  Example: >>> len = 1 >>>while len<=4: if len ==2: len=len+1 continue print(len) len=len+1
  • 30. Real world Application of Python  BitTorrent is made up in Python  Web and Internet Development  Scientific and Numeric: SciPy, Pandas, Ipython  Business Applications : Odoo, Tryton Source: topdevelopers.co%2Fblog%2F10-reasons-to-choose-python-web-development-project%2F&psig=AOvVaw 2drpI11_4MB70 UCf_c7W0S&ust=1589011542035214

Editor's Notes

  • #10: = operator -> Assigns the value at the right hand side to the variable at the left hand side.
  • #27: Also for is used within specific range >>> for i in range(1,6): print(i) 1 2 3 4 5 >>>
  • #29: While break statement stops the whole loop from execution, continue stops just an iteration of that loop.