SlideShare a Scribd company logo
1 of 29
DATA ANALYST
x
August 2023
#Future Ready: Future SkillS and Career Ready with MyEduSolve
1
2
4
3
AGENDA
A
B
C
5
INTRODUCTION
LEARN
ASSIGMENT & TASK
QUIZ & WRAP UP
Q & A
INTRODUCTION
Subject Overview
Objectives & Learning
Outcome
Learning how to use Python operation, flow control
and using modules to support Data analyst
• Understand how to using python operation
• Understand flow control
UNIT PLANNING
List of units/topics
• Evaluate
expressions
• Perform Data and
data type
operation
• Determine the
Sequences
• Select Operator
• Branching
Statement
• Iteration
What key concepts
that want to be
delivered in each
meetings/units/to
pics
• Understand
data types
• Understand
operators
• Flow controls
What skills that
students will gain
during each
meeting
• Logical
Mathematics
Breakdown
of curriculum
Key
Concepts
Skills
PYTHON FOR DATA
ANALYTICS
x
LEARNING MATERIALS
1. Operations using Data Types
and Operators
2. Flow Control with Decisions
and Loops
x
Operations using Data
Types and Operators
Data types
Data types in python
(int, float, string, Boolean)
Int Float
String Boolean
Int or Integer is a data type for
numeric objects in the form of
positive and negative integers. For
example, 1, 2, 3 or -1, -2, -3
Represents the floating-point
number. Float is used to represent
real numbers and is written with
decimal point i.e. 3.44
String contains sequence of
characters. It represents by using
single quotes or double quotes
Boolean is a true false statement,
symbolized by 1 and 0 or True and
False.
Num = 80
Print(Num)
⮚ 80
Fnum = 80.88
Print(Fnum)
⮚ 80.88
Str = “80” or Str = “Myname”
Print(Str) Print(Str)
⮚ 80 > Myname
a = True
Print(a)
True
Data types operation
• Implicit Type Conversion
• Explicit Type Conversion
Implicit Type Conversion
In Implicit type conversion, python automatically
converts on data type to another data type. This
process doesn’t need any user involvement.
Data types operation
• Implicit Type Conversion
• Explicit Type Conversion
Explicit Type Conversion
In Explicit type conversion, users convert the data
type of an object to required data type. We use the
predefined function like int(), float(), str(). example
Python Data Structure
The Basic Python structures in Python include list, set , tuples and dictionary. Each
of the data structures is in its own . Data structures are “containers” that organize
and group data according to type.
The data structures differ based on mutability and order. Mutability refers to the
ability to change an object after its creation. Mutable objects can be modified,
added, deleted after they have been created, while immutable objects cannot be
modified after their creation. Order, in this context relates to whether the position
of an element can be used to access the element.
Python Data Operators
Assignment Operators Comparison Operators
An assignment statement evaluates the expression
list(remember that this can be a single expression or
a comma-separated list, the latter yielding a tuple)
and assign the single result
Python has six comparison operators, which are as
follows:
• Less Than (<)
• Less Than or equal to (<=)
• Greater Than (>)
• Greater Than Equal (>=)
• Equal to (==)
• Not Equal to (!=)
These Comparison operators compare two values
and return Boolean value, either True or False.
Python Data Operators
Logical Operators
Logical operators are used on conditional statements
(either True or False). They perform Logical AND,
logical OR, and Logical Not operators. This operator
supports short-circuit evaluation, which mean that if
the first argument is False the second is never
evaluated.
X = 2
Y = 1
IF X > 2 and Y<1:
Print(True)
Else:
Print(False)
Example Code
Python Data Operators
Assignment Operators
Arithmetic operators are used with numeric values to
perform common mathematical operations:
X = 2
Y = 1
Sum = X + Y
⮚ 3
Subs = X-Y
⮚ 1
Example Code
Google Meet
HANDS ON
SESSION
Google Collab
x
Flow Control with
Decisions and Loops
Code Segments:
Branching
• IF Statement
• ELIF Statement
• ELSE Statement
• Nested IF Statement
• Compound I Conditional Statement
IF Statement
A selection statement that allows more than one
possible flow of control
ELIF Statement
Elif is short for "else if" and is used when the first if
statement isn't true, but you want to check for another
condition
ELSE Statement
The ELSE statement specifies that alternate
processing is to take place when the conditions of the
matching IF statement are not satisfied.
X = 2
Y = 1
IF X == 2 and Y ==1:
Print(“Correct”)
⮚ Correct
X = 2
IF X == 0:
Print(“False”)
Elif X >= 2:
Print(“Correct”)
⮚ Correct
Y = 1
IF Y ==2:
Print(“Correct”)
Else:
Print(“FALSE”)
⮚ FALSE
Code Segments: Branching
• IF Statement
• ELIF Statement
• ELSE Statement
• Nested IF Statement
• Compound Conditional Statement
NESTED IF Statement
Nested if is a decision-making statement that works
similar to other decision-making statements such as
if, else, if..else, etc.
var = 100
if var < 200:
print "Expression value is less than 200"
if var == 150:
print "Which is 150"
elif var == 100:
print "Which is 100"
elif var == 50:
print "Which is 50"
elif var < 50:
print "Expression value is less than 50"
else:
print "Could not find true expression"
⮚ Expression value is less than 200
⮚ Which is 100
Code Segments: Branching
• IF Statement
• ELIF Statement
• ELSE Statement
• Nested IF Statement
• Compound Conditional Statement
Compound Conditional Statement
Compound statements contain (groups of) other
statements; they affect or control the execution of
those other statements in some way. In general,
compound statements span multiple lines, although
in simple incarnations a whole compound statement
may be contained in one line
Code Segments: Iteration
• While
• For
• Break
• Continue
• Pass
• Nested Loop
While
The while statement is one of the control flow
statements in C# that enables the execution of a
sequence of logic multiple times in a loop until a
specific condition is false
For
The for statement lets you repeat a statement or
compound statement a specified number of times
X = 1
While X < 5:
Print(“Correct”)
X += 1
fruits = ["apple", "banana", "cherry"]
for x in fruits:
print(x)
Code Segments: Iteration
• While
• For
• Break
• Continue
• Pass
• Nested Loop
Break
A break statement in Python alters the flow of a loop
by terminating it once a specified condition is met
Continue
The continue statement in Python is used to skip the
remaining code inside a loop for the current iteration
only
for i in range(5):
if i == 3:
break
print(i)
for i in range(5):
if i == 3:
continue
print(i)
Code Segments: Iteration
• While
• For
• Break
• Continue
• Pass
• Nested Loop
Pass
The pass statement does nothing in Python, which is
helpful for using as a placeholder in if statement
branches, functions, and classes. In layman's terms,
pass tells Python to skip this line and do nothing.
Nested Loop
A nested loop refers to a loop within a loop, an inner
loop within the body of an outer one.
n = 10
# use pass inside if statement
if n > 10:
pass
print('Hello')
x = [1, 2]
y = [4, 5]
for i in x:
for j in y:
print(i, j)
Google Meet
HANDS ON
SESSION
Google Collab
GLOSSARY
NO Terms Definition
1 Indent
adding white space before
a statement to a particular
block of code
2 Indexing
the process of accessing
an element in a sequence
using its position in the
sequence (its index)
3 Slicing
a feature that enables
accessing parts of
sequences like strings,
tuples, and lists
4 Variable
a symbolic name that is a
reference or pointer to an
object
5 Infinity Loop
used to run a certain
program or block of code
an unspecified number of
times
ASSIGNMENT/TASK
TASK 1
Create looping to identify the even and odd
numbers
TASK 2
Create a loop to give a remarks of score. The remarks as follows:
A+ = 95-100
A=90-94
B+=85-89
B=80-84
C+=75-79
C= 70-74
Other score than that “Retake the course”
REFERRENCE / RESOURCES
https://www.w3schools.com/python/python_conditions.asp
https://www.w3schools.com/python/python_operators.asp
https://www.programiz.com/python-programming/operators
https://www.tutorialspoint.com/python/python_operators.htm
Google Meet
Quiz / Wrap Up
Questions
Google Meet
Q & A
SESSION
Python Week 1.pptx

More Related Content

Similar to Python Week 1.pptx

The Awesome Python Class Part-3
The Awesome Python Class Part-3The Awesome Python Class Part-3
The Awesome Python Class Part-3Binay Kumar Ray
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptxYusuf Ayuba
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statementsİbrahim Kürce
 
Kripanshu MOOC PPT - Kripanshu Shekhar Jha (1).pptx
Kripanshu MOOC PPT - Kripanshu Shekhar Jha (1).pptxKripanshu MOOC PPT - Kripanshu Shekhar Jha (1).pptx
Kripanshu MOOC PPT - Kripanshu Shekhar Jha (1).pptxsg4795
 
Python Revision Tour 1 Class XII CS
Python Revision Tour 1 Class XII CSPython Revision Tour 1 Class XII CS
Python Revision Tour 1 Class XII CSclass12sci
 
lecture4 pgdca.pptx
lecture4 pgdca.pptxlecture4 pgdca.pptx
lecture4 pgdca.pptxclassall
 
Python Basics by Akanksha Bali
Python Basics by Akanksha BaliPython Basics by Akanksha Bali
Python Basics by Akanksha BaliAkanksha Bali
 
PYTHON FULL TUTORIAL WITH PROGRAMMS
PYTHON FULL TUTORIAL WITH PROGRAMMSPYTHON FULL TUTORIAL WITH PROGRAMMS
PYTHON FULL TUTORIAL WITH PROGRAMMSAniruddha Paul
 
data handling revision.pptx
data handling revision.pptxdata handling revision.pptx
data handling revision.pptxDeepaRavi21
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1Syed Farjad Zia Zaidi
 
Operators in Python Arithmetic Operators
Operators in Python Arithmetic OperatorsOperators in Python Arithmetic Operators
Operators in Python Arithmetic Operatorsramireddyobulakondar
 

Similar to Python Week 1.pptx (20)

Python Essentials - PICT.pdf
Python Essentials - PICT.pdfPython Essentials - PICT.pdf
Python Essentials - PICT.pdf
 
The Awesome Python Class Part-3
The Awesome Python Class Part-3The Awesome Python Class Part-3
The Awesome Python Class Part-3
 
Python - Lecture 2
Python - Lecture 2Python - Lecture 2
Python - Lecture 2
 
unit1 python.pptx
unit1 python.pptxunit1 python.pptx
unit1 python.pptx
 
Python revision tour i
Python revision tour iPython revision tour i
Python revision tour i
 
Unit - 2 CAP.pptx
Unit - 2 CAP.pptxUnit - 2 CAP.pptx
Unit - 2 CAP.pptx
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptx
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Kripanshu MOOC PPT - Kripanshu Shekhar Jha (1).pptx
Kripanshu MOOC PPT - Kripanshu Shekhar Jha (1).pptxKripanshu MOOC PPT - Kripanshu Shekhar Jha (1).pptx
Kripanshu MOOC PPT - Kripanshu Shekhar Jha (1).pptx
 
Python Revision Tour 1 Class XII CS
Python Revision Tour 1 Class XII CSPython Revision Tour 1 Class XII CS
Python Revision Tour 1 Class XII CS
 
slides03.ppt
slides03.pptslides03.ppt
slides03.ppt
 
lecture4 pgdca.pptx
lecture4 pgdca.pptxlecture4 pgdca.pptx
lecture4 pgdca.pptx
 
Python Basics by Akanksha Bali
Python Basics by Akanksha BaliPython Basics by Akanksha Bali
Python Basics by Akanksha Bali
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
PYTHON FULL TUTORIAL WITH PROGRAMMS
PYTHON FULL TUTORIAL WITH PROGRAMMSPYTHON FULL TUTORIAL WITH PROGRAMMS
PYTHON FULL TUTORIAL WITH PROGRAMMS
 
data handling revision.pptx
data handling revision.pptxdata handling revision.pptx
data handling revision.pptx
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1
 
Operators in Python Arithmetic Operators
Operators in Python Arithmetic OperatorsOperators in Python Arithmetic Operators
Operators in Python Arithmetic Operators
 

Recently uploaded

DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...vershagrag
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 

Recently uploaded (20)

DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 

Python Week 1.pptx

  • 1. DATA ANALYST x August 2023 #Future Ready: Future SkillS and Career Ready with MyEduSolve
  • 3. INTRODUCTION Subject Overview Objectives & Learning Outcome Learning how to use Python operation, flow control and using modules to support Data analyst • Understand how to using python operation • Understand flow control
  • 4. UNIT PLANNING List of units/topics • Evaluate expressions • Perform Data and data type operation • Determine the Sequences • Select Operator • Branching Statement • Iteration What key concepts that want to be delivered in each meetings/units/to pics • Understand data types • Understand operators • Flow controls What skills that students will gain during each meeting • Logical Mathematics Breakdown of curriculum Key Concepts Skills
  • 6. LEARNING MATERIALS 1. Operations using Data Types and Operators 2. Flow Control with Decisions and Loops
  • 8. Data types Data types in python (int, float, string, Boolean) Int Float String Boolean Int or Integer is a data type for numeric objects in the form of positive and negative integers. For example, 1, 2, 3 or -1, -2, -3 Represents the floating-point number. Float is used to represent real numbers and is written with decimal point i.e. 3.44 String contains sequence of characters. It represents by using single quotes or double quotes Boolean is a true false statement, symbolized by 1 and 0 or True and False. Num = 80 Print(Num) ⮚ 80 Fnum = 80.88 Print(Fnum) ⮚ 80.88 Str = “80” or Str = “Myname” Print(Str) Print(Str) ⮚ 80 > Myname a = True Print(a) True
  • 9. Data types operation • Implicit Type Conversion • Explicit Type Conversion Implicit Type Conversion In Implicit type conversion, python automatically converts on data type to another data type. This process doesn’t need any user involvement.
  • 10. Data types operation • Implicit Type Conversion • Explicit Type Conversion Explicit Type Conversion In Explicit type conversion, users convert the data type of an object to required data type. We use the predefined function like int(), float(), str(). example
  • 11. Python Data Structure The Basic Python structures in Python include list, set , tuples and dictionary. Each of the data structures is in its own . Data structures are “containers” that organize and group data according to type. The data structures differ based on mutability and order. Mutability refers to the ability to change an object after its creation. Mutable objects can be modified, added, deleted after they have been created, while immutable objects cannot be modified after their creation. Order, in this context relates to whether the position of an element can be used to access the element.
  • 12. Python Data Operators Assignment Operators Comparison Operators An assignment statement evaluates the expression list(remember that this can be a single expression or a comma-separated list, the latter yielding a tuple) and assign the single result Python has six comparison operators, which are as follows: • Less Than (<) • Less Than or equal to (<=) • Greater Than (>) • Greater Than Equal (>=) • Equal to (==) • Not Equal to (!=) These Comparison operators compare two values and return Boolean value, either True or False.
  • 13. Python Data Operators Logical Operators Logical operators are used on conditional statements (either True or False). They perform Logical AND, logical OR, and Logical Not operators. This operator supports short-circuit evaluation, which mean that if the first argument is False the second is never evaluated. X = 2 Y = 1 IF X > 2 and Y<1: Print(True) Else: Print(False) Example Code
  • 14. Python Data Operators Assignment Operators Arithmetic operators are used with numeric values to perform common mathematical operations: X = 2 Y = 1 Sum = X + Y ⮚ 3 Subs = X-Y ⮚ 1 Example Code
  • 17. Code Segments: Branching • IF Statement • ELIF Statement • ELSE Statement • Nested IF Statement • Compound I Conditional Statement IF Statement A selection statement that allows more than one possible flow of control ELIF Statement Elif is short for "else if" and is used when the first if statement isn't true, but you want to check for another condition ELSE Statement The ELSE statement specifies that alternate processing is to take place when the conditions of the matching IF statement are not satisfied. X = 2 Y = 1 IF X == 2 and Y ==1: Print(“Correct”) ⮚ Correct X = 2 IF X == 0: Print(“False”) Elif X >= 2: Print(“Correct”) ⮚ Correct Y = 1 IF Y ==2: Print(“Correct”) Else: Print(“FALSE”) ⮚ FALSE
  • 18. Code Segments: Branching • IF Statement • ELIF Statement • ELSE Statement • Nested IF Statement • Compound Conditional Statement NESTED IF Statement Nested if is a decision-making statement that works similar to other decision-making statements such as if, else, if..else, etc. var = 100 if var < 200: print "Expression value is less than 200" if var == 150: print "Which is 150" elif var == 100: print "Which is 100" elif var == 50: print "Which is 50" elif var < 50: print "Expression value is less than 50" else: print "Could not find true expression" ⮚ Expression value is less than 200 ⮚ Which is 100
  • 19. Code Segments: Branching • IF Statement • ELIF Statement • ELSE Statement • Nested IF Statement • Compound Conditional Statement Compound Conditional Statement Compound statements contain (groups of) other statements; they affect or control the execution of those other statements in some way. In general, compound statements span multiple lines, although in simple incarnations a whole compound statement may be contained in one line
  • 20. Code Segments: Iteration • While • For • Break • Continue • Pass • Nested Loop While The while statement is one of the control flow statements in C# that enables the execution of a sequence of logic multiple times in a loop until a specific condition is false For The for statement lets you repeat a statement or compound statement a specified number of times X = 1 While X < 5: Print(“Correct”) X += 1 fruits = ["apple", "banana", "cherry"] for x in fruits: print(x)
  • 21. Code Segments: Iteration • While • For • Break • Continue • Pass • Nested Loop Break A break statement in Python alters the flow of a loop by terminating it once a specified condition is met Continue The continue statement in Python is used to skip the remaining code inside a loop for the current iteration only for i in range(5): if i == 3: break print(i) for i in range(5): if i == 3: continue print(i)
  • 22. Code Segments: Iteration • While • For • Break • Continue • Pass • Nested Loop Pass The pass statement does nothing in Python, which is helpful for using as a placeholder in if statement branches, functions, and classes. In layman's terms, pass tells Python to skip this line and do nothing. Nested Loop A nested loop refers to a loop within a loop, an inner loop within the body of an outer one. n = 10 # use pass inside if statement if n > 10: pass print('Hello') x = [1, 2] y = [4, 5] for i in x: for j in y: print(i, j)
  • 24. GLOSSARY NO Terms Definition 1 Indent adding white space before a statement to a particular block of code 2 Indexing the process of accessing an element in a sequence using its position in the sequence (its index) 3 Slicing a feature that enables accessing parts of sequences like strings, tuples, and lists 4 Variable a symbolic name that is a reference or pointer to an object 5 Infinity Loop used to run a certain program or block of code an unspecified number of times
  • 25. ASSIGNMENT/TASK TASK 1 Create looping to identify the even and odd numbers TASK 2 Create a loop to give a remarks of score. The remarks as follows: A+ = 95-100 A=90-94 B+=85-89 B=80-84 C+=75-79 C= 70-74 Other score than that “Retake the course”
  • 27. Google Meet Quiz / Wrap Up Questions
  • 28. Google Meet Q & A SESSION