SlideShare a Scribd company logo
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Python Programming
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
➢ Install Python
➢ Install PyCharm - IDE for Python
➢ Python Programming
▪ Variables
▪ Data types
▪ Operators
▪ Conditional Statements
▪ Loops
▪ Functions
▪ Classes and Objects
➢ Summary
Agenda
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Python Installation
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Pycharm Installation
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Variables
Data types
Operators
Conditional
Statements
Loops
Functions
Classes and
Objects
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Python Variable
C=‘edureka’
A = 16
B = 20
C = ‘edureka’
B=20
A=16 Memory
Memory
Memory
Variable
Variables are nothing but reserved memory locations to store values. This means that when you
create a variable you reserve some space in memory.
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Variables
Data types
Operators
Conditional
Statements
Loops
Functions
Classes and
Objects
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Data types
Python Data types
A data type, in programming, is a classification that specifies which type of value a variable has and what
type of mathematical, relational or logical operations can be applied to it without causing an error.
C=‘edureka’
A = 16
B = 20
C = ‘edureka’
B=20
A=16 Integer
Datatype
Integer
Datatype
String
Datatype
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Python Data types
Data types
Numeric
List
Tuple
Strings
Set
Dictionary
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Tuples
Strings
Set
Dictionary
Numeric1
3
4
5
6
Lists32
Numeric Data type
 Number data types are used to store numeric values.
 There are four different numerical types in Python:
A = 16
B = 1.678
C = 2 + i6
D = 909065*35353537
Integer Type
Float Type
Complex Type
Long Type
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Tuples
Strings
Set
Dictionary
Numeric1
3
4
5
6
Lists22
List Data type
The list is a most versatile datatype available in Python which can be written as a list of
comma-separated values (items) between square brackets
list1 = ['physics', 'chemistry', 1997, 2000]For example:
Accessing Values in Lists
Updating List
Delete List Elements
List Length
Concatenation
Repetition
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Tuples Data type
Tuples
Strings
Set
Dictionary
Numeric1
3
4
5
6
Tuples23
Lists32
A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists.
Tup1 = ('physics', 'chemistry', 1997, 2000)For example:
Accessing Values in Tuple
Updating Tuple
Delete Tuple Elements
Tuple Length
Concatenation
Repetition
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
String Data type
Strings
Set
Dictionary
Numeric1
4
5
6
Lists32
Strings24
Tuples3
A string in Python is a sequence of characters. We can create Strings by enclosing
characters in quotes. Python treats single quotes the same as double quotes. Consider
the example below:
Operation Syntax
String Length print(len(string_name))
Locate a character in string print(strig_name.index(“Char"))
Count the number of times a character is
repeated in a string
print(string_name.count("Char"))
Print a part of the string print(string_name[start:stop])
Reverse a string print(string_name[::-1])
Convert the letters in a string to upper-case print(string_name.upper())
Convert the letters in a string to lower-case print(string_name.lower())
A = ‘Master Python At edureka’
B = ‘Welcome to edureka!’
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Set Data type
Set
Dictionary
Numeric1
5
6
Lists32
Tuples3
Strings4 Set25
Strings4
Set is an unordered collection of unique items. Set is defined by
values separated by comma inside braces { }.
For Example:
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Dictionary Data type
Dictionary
Numeric1
6
Lists32
Tuples3
Strings4
Set5 Strings4 Dictionary26
Set5
Dictionary is an unordered collection of key-value pairs. It is
generally used when we have a huge amount of data.
For Example:
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Variables
Operators
Conditional
Statements
Loops
Functions
Classes and
Objects
Data types
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Python Operations
Operators
Identity
Operators
Membership
Operators
Comparison
Operators
Arithmetic
Operators
Assignment
Operators
Logical
Operators
Bitwise
Operators
Operations Operators are the constructs which can manipulate the value of operands.
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Arithmetic and Comparison Operators
Arithmetic Comparison
a + b
a – b
a * b
a / b
a % b
a ** b
Addition
Multiplication
Subtraction
Division
Modulus
Exponent
a == b
a != b
a > b
a < b
a >= b
a <= b
Equal To
Greater Than
Not Equal To
Less Than
Greater Than Equal To
Less Than Equal To
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Assignment and identity Operator
Assignment
a = b
a + = b
a - = b
a * = b
a /= b
a** = b
Assigns value from right to left
a = a - b
a = a + b
a = a*b
a = a/b
a = a**b
Identity
is
is not
Evaluates to true if the variables on
either side of the operator point to
the same object and false
otherwise.
Evaluates to false if the variables on
either side of the operator point to
the same object and true otherwise.
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Membership and Bitwise Operator
Membership
in
not in
Evaluates to true if it finds a
variable in the specified
sequence and false otherwise.
Evaluates to true if it does not
find a variable in the specified
sequence and false otherwise.
Bitwise
a & b
a | b
a ^ b
a ~ b
a <<
a >> b
Binary AND
Binary OR
Binary XOR
Binary NOT
Binary Left Shift
Binary Right Shift
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Logical Operator
There are three types of logical operators: Logical AND, Logical NOT, Logical OR
a and b
a or b
Returns a if a is false, b otherwise
Returns b if b is false, a otherwise
not a Returns True if a is True, False otherwise
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Variables Operators
Conditional
Statements
Loops
Functions
Classes and
Objects
Data types
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Conditional Statements in Python
If Statement
Syntax:
If code
End
Start
Condition
is true
Condition
Condition
is false
Exit
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Conditional Statements in Python
Elif Statement
If code
End
Start
Condition
is true
Condition
If condition is
false
Elif codeSyntax:
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Conditional Statements in Python
Else code If code
Elif condition
is false
If condition
is true
Elif code
If condition is
false
Condition
End
StartElse Statement
Syntax:
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Variables Operators
Conditional
Statements
Loops
Functions
Classes and
Objects
Data types
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Loops in Python
A loop statement allows us to execute a statement or group of statements multiple
times. The following diagram illustrates a loop statement:Loops
Loops
NestedForWhile
Start
Conditional Code
Condition
If condition is
false
If condition is
true
End
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
While Loop
While Loop
Repeats a statement or group of statements while a given condition is TRUE. It tests
the condition before executing the loop body.
Syntax:
Start
Conditional Code
End
If condition
is true
If condition
is false
Condition
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
For Loop
For Loop
Repeats a statement or group of statements while a given condition is TRUE. It tests
the condition before executing the loop body.
Syntax:
Start
Execute Statement (s)
End
Next item from
sequence
If no more items in the
sequenceItem from
sequence
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Nested Loops in Python
Nested Loops
Python programming language allows use of one loop inside another
loop. This is called Nested Loop, below is the syntax for the same:
Syntax: Syntax:
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Variables Operators
Conditional
Statements
Loops
Functions
Classes and
Objects
Data types
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Functions in Python
Functions
A function is a block of organized, reusable code that is used to perform a single,
related action.
Functions
Predefined
Functions
User Defined
Functions
Function
Add
Call (3,5)
Call (6,9)
Call (1,5)
Call 1
Call 2
Call 3
Return 8
Return 15
Return 6
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Variables Operators
Conditional
Statements
Loops
Functions
Classes and
Objects
Data types
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Classes and Objects in Python
Classes and Objects
 A class is the blueprint from which specific objects are created.
 Anything that has a state and behavior is object.
Class
Object
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Session In A Minute
Install Python Variables, Data types, Operators
Loops Functions
Conditional Statements
Classes and Objects
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Thank You …
Questions/Queries/Feedback

More Related Content

PDF
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Edureka!
 
PDF
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Edureka!
 
PDF
Python Class | Python Programming | Python Tutorial | Edureka
Edureka!
 
PDF
Introduction To Python
Vanessa Rene
 
PPT
Introduction to Python
amiable_indian
 
PDF
Python Sequence | Python Lists | Python Sets & Dictionary | Python Strings | ...
Edureka!
 
PDF
Machine Learning in 10 Minutes | What is Machine Learning? | Edureka
Edureka!
 
PPTX
Genetic algorithm for hyperparameter tuning
Dr. Jyoti Obia
 
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Edureka!
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Edureka!
 
Python Class | Python Programming | Python Tutorial | Edureka
Edureka!
 
Introduction To Python
Vanessa Rene
 
Introduction to Python
amiable_indian
 
Python Sequence | Python Lists | Python Sets & Dictionary | Python Strings | ...
Edureka!
 
Machine Learning in 10 Minutes | What is Machine Learning? | Edureka
Edureka!
 
Genetic algorithm for hyperparameter tuning
Dr. Jyoti Obia
 

What's hot (20)

PDF
Python Matplotlib Tutorial | Matplotlib Tutorial | Python Tutorial | Python T...
Edureka!
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PDF
Introduction To Python | Edureka
Edureka!
 
PPTX
Python basics
Jyoti shukla
 
PDF
Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Edureka!
 
PPTX
Scikit-Learn Tutorial | Machine Learning With Scikit-Learn | Sklearn | Python...
Simplilearn
 
PDF
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Edureka!
 
PDF
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Edureka!
 
PDF
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Edureka!
 
ODP
Python Presentation
Narendra Sisodiya
 
PPTX
Presentation on data preparation with pandas
AkshitaKanther
 
PPTX
A Beginner's Guide to Machine Learning with Scikit-Learn
Sarah Guido
 
PPTX
Statistics vs machine learning
Tom Dierickx
 
PDF
Python Intro
Tim Penhey
 
PDF
What is Python? | Edureka
Edureka!
 
PDF
Introduction to Machine Learning with SciKit-Learn
Benjamin Bengfort
 
PDF
Python Crash Course
Haim Michael
 
PDF
Python Machine Learning Tutorial | Machine Learning Algorithms | Python Train...
Edureka!
 
PDF
Statistics And Probability Tutorial | Statistics And Probability for Data Sci...
Edureka!
 
PPTX
Python programming | Fundamentals of Python programming
KrishnaMildain
 
Python Matplotlib Tutorial | Matplotlib Tutorial | Python Tutorial | Python T...
Edureka!
 
Python Programming Tutorial | Edureka
Edureka!
 
Introduction To Python | Edureka
Edureka!
 
Python basics
Jyoti shukla
 
Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Edureka!
 
Scikit-Learn Tutorial | Machine Learning With Scikit-Learn | Sklearn | Python...
Simplilearn
 
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Edureka!
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Edureka!
 
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Edureka!
 
Python Presentation
Narendra Sisodiya
 
Presentation on data preparation with pandas
AkshitaKanther
 
A Beginner's Guide to Machine Learning with Scikit-Learn
Sarah Guido
 
Statistics vs machine learning
Tom Dierickx
 
Python Intro
Tim Penhey
 
What is Python? | Edureka
Edureka!
 
Introduction to Machine Learning with SciKit-Learn
Benjamin Bengfort
 
Python Crash Course
Haim Michael
 
Python Machine Learning Tutorial | Machine Learning Algorithms | Python Train...
Edureka!
 
Statistics And Probability Tutorial | Statistics And Probability for Data Sci...
Edureka!
 
Python programming | Fundamentals of Python programming
KrishnaMildain
 
Ad

Similar to Python Programming | Python Programming For Beginners | Python Tutorial | Edureka (20)

PDF
R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...
Edureka!
 
PDF
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Edureka!
 
PDF
Python Interview Questions And Answers 2019 | Edureka
Edureka!
 
PDF
Python Basics | Python Tutorial | Edureka
Edureka!
 
PDF
1_1_python-course-notes-sections-1-7.pdf
Javier Crisostomo
 
PPTX
Basic of Python- Hands on Session
Dharmesh Tank
 
PPTX
Python basics
TIB Academy
 
PDF
Variables & Data Types In Python | Edureka
Edureka!
 
PPTX
010 CONDITION USING IF-converted.pptx
SSPTRGCELL
 
PDF
Reinforcement Learning Tutorial | Edureka
Edureka!
 
PPT
UNIT II_python Programming_aditya College
Ramanamurthy Banda
 
PDF
What is Range Function? | Range in Python Explained | Edureka
Edureka!
 
DOCX
C# language basics (Visual Studio)
rnkhan
 
DOCX
C# language basics (Visual studio)
rnkhan
 
PPTX
modul-python-all.pptx
Yusuf Ayuba
 
PPTX
Lhahahhahahhahhhahahhajjsaaecture 6.pptx
GiancarlosGumatay
 
PDF
Java Programming | Java Tutorial For Beginners | Java Training | Edureka
Edureka!
 
PPT
Python session3
Aswin Krishnamoorthy
 
ODP
Dynamic Python
Chui-Wen Chiu
 
PPTX
Python for Traders - Introduction to Python for Trading
Marketcalls
 
R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...
Edureka!
 
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Edureka!
 
Python Interview Questions And Answers 2019 | Edureka
Edureka!
 
Python Basics | Python Tutorial | Edureka
Edureka!
 
1_1_python-course-notes-sections-1-7.pdf
Javier Crisostomo
 
Basic of Python- Hands on Session
Dharmesh Tank
 
Python basics
TIB Academy
 
Variables & Data Types In Python | Edureka
Edureka!
 
010 CONDITION USING IF-converted.pptx
SSPTRGCELL
 
Reinforcement Learning Tutorial | Edureka
Edureka!
 
UNIT II_python Programming_aditya College
Ramanamurthy Banda
 
What is Range Function? | Range in Python Explained | Edureka
Edureka!
 
C# language basics (Visual Studio)
rnkhan
 
C# language basics (Visual studio)
rnkhan
 
modul-python-all.pptx
Yusuf Ayuba
 
Lhahahhahahhahhhahahhajjsaaecture 6.pptx
GiancarlosGumatay
 
Java Programming | Java Tutorial For Beginners | Java Training | Edureka
Edureka!
 
Python session3
Aswin Krishnamoorthy
 
Dynamic Python
Chui-Wen Chiu
 
Python for Traders - Introduction to Python for Trading
Marketcalls
 
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
PDF
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
PDF
Tableau Tutorial for Data Science | Edureka
Edureka!
 
PDF
Top 5 PMP Certifications | Edureka
Edureka!
 
PDF
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
PDF
Linux Mint Tutorial | Edureka
Edureka!
 
PDF
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
PDF
Importance of Digital Marketing | Edureka
Edureka!
 
PDF
RPA in 2020 | Edureka
Edureka!
 
PDF
Email Notifications in Jenkins | Edureka
Edureka!
 
PDF
EA Algorithm in Machine Learning | Edureka
Edureka!
 
PDF
Cognitive AI Tutorial | Edureka
Edureka!
 
PDF
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
PDF
Blue Prism Top Interview Questions | Edureka
Edureka!
 
PDF
Big Data on AWS Tutorial | Edureka
Edureka!
 
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
PDF
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
PDF
Introduction to DevOps | Edureka
Edureka!
 
PDF
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Edureka!
 
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
Edureka!
 

Recently uploaded (20)

PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PPT
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Software Development Company | KodekX
KodekX
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
This slide provides an overview Technology
mineshkharadi333
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 

Python Programming | Python Programming For Beginners | Python Tutorial | Edureka

  • 2. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING ➢ Install Python ➢ Install PyCharm - IDE for Python ➢ Python Programming ▪ Variables ▪ Data types ▪ Operators ▪ Conditional Statements ▪ Loops ▪ Functions ▪ Classes and Objects ➢ Summary Agenda
  • 5. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Variables Data types Operators Conditional Statements Loops Functions Classes and Objects
  • 6. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Python Variable C=‘edureka’ A = 16 B = 20 C = ‘edureka’ B=20 A=16 Memory Memory Memory Variable Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory.
  • 7. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Variables Data types Operators Conditional Statements Loops Functions Classes and Objects
  • 8. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Data types Python Data types A data type, in programming, is a classification that specifies which type of value a variable has and what type of mathematical, relational or logical operations can be applied to it without causing an error. C=‘edureka’ A = 16 B = 20 C = ‘edureka’ B=20 A=16 Integer Datatype Integer Datatype String Datatype
  • 9. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Python Data types Data types Numeric List Tuple Strings Set Dictionary
  • 10. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Tuples Strings Set Dictionary Numeric1 3 4 5 6 Lists32 Numeric Data type  Number data types are used to store numeric values.  There are four different numerical types in Python: A = 16 B = 1.678 C = 2 + i6 D = 909065*35353537 Integer Type Float Type Complex Type Long Type
  • 11. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Tuples Strings Set Dictionary Numeric1 3 4 5 6 Lists22 List Data type The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets list1 = ['physics', 'chemistry', 1997, 2000]For example: Accessing Values in Lists Updating List Delete List Elements List Length Concatenation Repetition
  • 12. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Tuples Data type Tuples Strings Set Dictionary Numeric1 3 4 5 6 Tuples23 Lists32 A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. Tup1 = ('physics', 'chemistry', 1997, 2000)For example: Accessing Values in Tuple Updating Tuple Delete Tuple Elements Tuple Length Concatenation Repetition
  • 13. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING String Data type Strings Set Dictionary Numeric1 4 5 6 Lists32 Strings24 Tuples3 A string in Python is a sequence of characters. We can create Strings by enclosing characters in quotes. Python treats single quotes the same as double quotes. Consider the example below: Operation Syntax String Length print(len(string_name)) Locate a character in string print(strig_name.index(“Char")) Count the number of times a character is repeated in a string print(string_name.count("Char")) Print a part of the string print(string_name[start:stop]) Reverse a string print(string_name[::-1]) Convert the letters in a string to upper-case print(string_name.upper()) Convert the letters in a string to lower-case print(string_name.lower()) A = ‘Master Python At edureka’ B = ‘Welcome to edureka!’
  • 14. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Set Data type Set Dictionary Numeric1 5 6 Lists32 Tuples3 Strings4 Set25 Strings4 Set is an unordered collection of unique items. Set is defined by values separated by comma inside braces { }. For Example:
  • 15. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Dictionary Data type Dictionary Numeric1 6 Lists32 Tuples3 Strings4 Set5 Strings4 Dictionary26 Set5 Dictionary is an unordered collection of key-value pairs. It is generally used when we have a huge amount of data. For Example:
  • 16. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Variables Operators Conditional Statements Loops Functions Classes and Objects Data types
  • 17. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Python Operations Operators Identity Operators Membership Operators Comparison Operators Arithmetic Operators Assignment Operators Logical Operators Bitwise Operators Operations Operators are the constructs which can manipulate the value of operands.
  • 18. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Arithmetic and Comparison Operators Arithmetic Comparison a + b a – b a * b a / b a % b a ** b Addition Multiplication Subtraction Division Modulus Exponent a == b a != b a > b a < b a >= b a <= b Equal To Greater Than Not Equal To Less Than Greater Than Equal To Less Than Equal To
  • 19. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Assignment and identity Operator Assignment a = b a + = b a - = b a * = b a /= b a** = b Assigns value from right to left a = a - b a = a + b a = a*b a = a/b a = a**b Identity is is not Evaluates to true if the variables on either side of the operator point to the same object and false otherwise. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise.
  • 20. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Membership and Bitwise Operator Membership in not in Evaluates to true if it finds a variable in the specified sequence and false otherwise. Evaluates to true if it does not find a variable in the specified sequence and false otherwise. Bitwise a & b a | b a ^ b a ~ b a << a >> b Binary AND Binary OR Binary XOR Binary NOT Binary Left Shift Binary Right Shift
  • 21. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Logical Operator There are three types of logical operators: Logical AND, Logical NOT, Logical OR a and b a or b Returns a if a is false, b otherwise Returns b if b is false, a otherwise not a Returns True if a is True, False otherwise
  • 22. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Variables Operators Conditional Statements Loops Functions Classes and Objects Data types
  • 23. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Conditional Statements in Python If Statement Syntax: If code End Start Condition is true Condition Condition is false Exit
  • 24. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Conditional Statements in Python Elif Statement If code End Start Condition is true Condition If condition is false Elif codeSyntax:
  • 25. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Conditional Statements in Python Else code If code Elif condition is false If condition is true Elif code If condition is false Condition End StartElse Statement Syntax:
  • 26. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Variables Operators Conditional Statements Loops Functions Classes and Objects Data types
  • 27. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Loops in Python A loop statement allows us to execute a statement or group of statements multiple times. The following diagram illustrates a loop statement:Loops Loops NestedForWhile Start Conditional Code Condition If condition is false If condition is true End
  • 28. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING While Loop While Loop Repeats a statement or group of statements while a given condition is TRUE. It tests the condition before executing the loop body. Syntax: Start Conditional Code End If condition is true If condition is false Condition
  • 29. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING For Loop For Loop Repeats a statement or group of statements while a given condition is TRUE. It tests the condition before executing the loop body. Syntax: Start Execute Statement (s) End Next item from sequence If no more items in the sequenceItem from sequence
  • 30. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Nested Loops in Python Nested Loops Python programming language allows use of one loop inside another loop. This is called Nested Loop, below is the syntax for the same: Syntax: Syntax:
  • 31. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Variables Operators Conditional Statements Loops Functions Classes and Objects Data types
  • 32. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Functions in Python Functions A function is a block of organized, reusable code that is used to perform a single, related action. Functions Predefined Functions User Defined Functions Function Add Call (3,5) Call (6,9) Call (1,5) Call 1 Call 2 Call 3 Return 8 Return 15 Return 6
  • 33. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Variables Operators Conditional Statements Loops Functions Classes and Objects Data types
  • 34. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Classes and Objects in Python Classes and Objects  A class is the blueprint from which specific objects are created.  Anything that has a state and behavior is object. Class Object
  • 35. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Session In A Minute Install Python Variables, Data types, Operators Loops Functions Conditional Statements Classes and Objects
  • 36. www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING Thank You … Questions/Queries/Feedback