SlideShare a Scribd company logo
Function
& Looping
Python Programming Language
In Python, a
function is a
group of related
statements that
performs a
specific task. It
help us work
faster, simplify
our code and
avoids repetition.
It takes in an input.
It does something
to that input.
It gives back an
output.
Generally, a function
displays this pattern:
STRUCTURE OF A
FUNCTION
Built-in functions - Functions
that are built into Python. Ex:
sum(), max(), etc.
User-defined functions -
Functions defined by the users
themselves.
Basically, we can divide functions
into the following two types:
1.
2.
TYPE OF
FUNCTION
Python offers us an easy way to repeat
a process, which helps us when we
need to repeat a process hundreds,
thousands, or even millions of times.
Let's say we have a list [3, 5, 1, 2]
assigned to a variable ratings, and we
want to repeat the following process:
for each element in ratings, print its
index and itself. This is how we could
translate that into Python syntax:
LOOPING IN
PYTHON
The technique used
previously is called a
loop, because we
always start with for
(like in for
some_variable in
some_list:), this
technique is known
as a for loop.
STRUCTURE OF
LOOPING
PIPELINE TEAM
INES DESDEMARSA
NOVITA SARI

More Related Content

What's hot (20)

PPTX
structured programming
Ahmad54321
 
PPTX
Actors model in gpars
NexThoughts Technologies
 
PPTX
Function in C Programming
Anil Pokhrel
 
PPTX
Functions
Septi Ratnasari
 
PPT
Python Built-in Functions and Use cases
Srajan Mor
 
PPTX
Functions in C
Kamal Acharya
 
PDF
Function arguments In Python
Amit Upadhyay
 
PPT
Basic structure of C++ program
matiur rahman
 
PPTX
Python functions
Aliyamanasa
 
PDF
Introduction to MPI
Akhila Prabhakaran
 
PPTX
Function Parameters
primeteacher32
 
DOCX
Functions assignment
Ahmad Kamal
 
PPTX
Funtion
Lutfullah Haqnesar
 
PPTX
Git, Docker, Python Package and Module
Novita Sari
 
PPTX
C++ first s lide
Sudhriti Gupta
 
PPTX
Operator Overloading and Scope of Variable
MOHIT DADU
 
PPTX
Function overloading in c++
Learn By Watch
 
PDF
Java modular extension for operator overloading
ijpla
 
PPTX
Functions in c
reshmy12
 
structured programming
Ahmad54321
 
Actors model in gpars
NexThoughts Technologies
 
Function in C Programming
Anil Pokhrel
 
Functions
Septi Ratnasari
 
Python Built-in Functions and Use cases
Srajan Mor
 
Functions in C
Kamal Acharya
 
Function arguments In Python
Amit Upadhyay
 
Basic structure of C++ program
matiur rahman
 
Python functions
Aliyamanasa
 
Introduction to MPI
Akhila Prabhakaran
 
Function Parameters
primeteacher32
 
Functions assignment
Ahmad Kamal
 
Git, Docker, Python Package and Module
Novita Sari
 
C++ first s lide
Sudhriti Gupta
 
Operator Overloading and Scope of Variable
MOHIT DADU
 
Function overloading in c++
Learn By Watch
 
Java modular extension for operator overloading
ijpla
 
Functions in c
reshmy12
 

Similar to Python Function and Looping (20)

PPTX
function_xii-BY APARNA DENDRE (1).pdf.pptx
g84017903
 
PPTX
Python for Data Science function third module ppt.pptx
bmit1
 
PPTX
functions.pptx
KavithaChekuri3
 
PDF
2-functions.pptx_20240619_085610_0000.pdf
amiyaratan18
 
PPTX
Decided to go to the 65 and the value of the number
harshoberoi2050
 
PPTX
UNIT-02-pythonfunctions python function using detehdjsjehhdjejdhdjdjdjddjdhdhhd
tony8553004135
 
PPTX
Functions_new.pptx
Yagna15
 
PPT
ppt3-conditionalstatementloopsdictionaryfunctions-240731050730-455ba0fa.ppt
avishekpradhan24
 
PPTX
PP unit 2.pptx.................................
MathanrajS6
 
PPTX
PP unit 2.pptx............................
MathanrajS6
 
PPT
PPT3-CONDITIONAL STATEMENT LOOPS DICTIONARY FUNCTIONS.ppt
RahulKumar812056
 
PDF
Functions-.pdf
arvdexamsection
 
PPTX
_Python_ Functions _and_ Libraries_.pptx
yaramahsoob
 
PPTX
Functions in python, types of functions in python
SherinRappai
 
PPTX
FUNCTIONINPYTHON.pptx
SheetalMavi2
 
PDF
Chapter Functions for grade 12 computer Science
KrithikaTM
 
PDF
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
lailoesakhan
 
PDF
Python functions and loops
thirumurugan133
 
PDF
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
prasadmutkule1
 
PPTX
Python Session - 4
AnirudhaGaikwad4
 
function_xii-BY APARNA DENDRE (1).pdf.pptx
g84017903
 
Python for Data Science function third module ppt.pptx
bmit1
 
functions.pptx
KavithaChekuri3
 
2-functions.pptx_20240619_085610_0000.pdf
amiyaratan18
 
Decided to go to the 65 and the value of the number
harshoberoi2050
 
UNIT-02-pythonfunctions python function using detehdjsjehhdjejdhdjdjdjddjdhdhhd
tony8553004135
 
Functions_new.pptx
Yagna15
 
ppt3-conditionalstatementloopsdictionaryfunctions-240731050730-455ba0fa.ppt
avishekpradhan24
 
PP unit 2.pptx.................................
MathanrajS6
 
PP unit 2.pptx............................
MathanrajS6
 
PPT3-CONDITIONAL STATEMENT LOOPS DICTIONARY FUNCTIONS.ppt
RahulKumar812056
 
Functions-.pdf
arvdexamsection
 
_Python_ Functions _and_ Libraries_.pptx
yaramahsoob
 
Functions in python, types of functions in python
SherinRappai
 
FUNCTIONINPYTHON.pptx
SheetalMavi2
 
Chapter Functions for grade 12 computer Science
KrithikaTM
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
lailoesakhan
 
Python functions and loops
thirumurugan133
 
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
prasadmutkule1
 
Python Session - 4
AnirudhaGaikwad4
 
Ad

More from Novita Sari (12)

PPTX
Advanced python
Novita Sari
 
PDF
Summary python coding
Novita Sari
 
PDF
Summary machine learning and model deployment
Novita Sari
 
PDF
Summary legal
Novita Sari
 
PDF
Summary introduction to data engineering
Novita Sari
 
PDF
Summary data visualization
Novita Sari
 
PDF
Summary data modelling
Novita Sari
 
PDF
Summary business knowledge for data professional
Novita Sari
 
PDF
Practice case legal for data professional
Novita Sari
 
PDF
Big data tools
Novita Sari
 
PDF
OOP, Networking, Linux/Unix
Novita Sari
 
PDF
Basic Data Engineering
Novita Sari
 
Advanced python
Novita Sari
 
Summary python coding
Novita Sari
 
Summary machine learning and model deployment
Novita Sari
 
Summary legal
Novita Sari
 
Summary introduction to data engineering
Novita Sari
 
Summary data visualization
Novita Sari
 
Summary data modelling
Novita Sari
 
Summary business knowledge for data professional
Novita Sari
 
Practice case legal for data professional
Novita Sari
 
Big data tools
Novita Sari
 
OOP, Networking, Linux/Unix
Novita Sari
 
Basic Data Engineering
Novita Sari
 
Ad

Recently uploaded (20)

PPTX
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
PDF
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays
 
PPT
01 presentation finyyyal معهد معايره.ppt
eltohamym057
 
PDF
Choosing the Right Database for Indexing.pdf
Tamanna
 
PPT
1 DATALINK CONTROL and it's applications
karunanidhilithesh
 
PPTX
Climate Action.pptx action plan for climate
justfortalabat
 
PPTX
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
PPTX
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
PPTX
Slide studies GC- CRC - PC - HNC baru.pptx
LLen8
 
PDF
How to Avoid 7 Costly Mainframe Migration Mistakes
JP Infra Pvt Ltd
 
PPTX
This PowerPoint presentation titled "Data Visualization: Turning Data into In...
HemaDivyaKantamaneni
 
PPTX
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
PDF
AUDITABILITY & COMPLIANCE OF AI SYSTEMS IN HEALTHCARE
GAHI Youssef
 
PDF
Building Production-Ready AI Agents with LangGraph.pdf
Tamanna
 
DOCX
AI/ML Applications in Financial domain projects
Rituparna De
 
PDF
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
PPTX
Human-Action-Recognition-Understanding-Behavior.pptx
nreddyjanga
 
PPTX
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
PDF
T2_01 Apuntes La Materia.pdfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxskksk
mathiasdasilvabarcia
 
PDF
R Cookbook - Processing and Manipulating Geological spatial data with R.pdf
OtnielSimopiaref2
 
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays
 
01 presentation finyyyal معهد معايره.ppt
eltohamym057
 
Choosing the Right Database for Indexing.pdf
Tamanna
 
1 DATALINK CONTROL and it's applications
karunanidhilithesh
 
Climate Action.pptx action plan for climate
justfortalabat
 
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
Slide studies GC- CRC - PC - HNC baru.pptx
LLen8
 
How to Avoid 7 Costly Mainframe Migration Mistakes
JP Infra Pvt Ltd
 
This PowerPoint presentation titled "Data Visualization: Turning Data into In...
HemaDivyaKantamaneni
 
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
AUDITABILITY & COMPLIANCE OF AI SYSTEMS IN HEALTHCARE
GAHI Youssef
 
Building Production-Ready AI Agents with LangGraph.pdf
Tamanna
 
AI/ML Applications in Financial domain projects
Rituparna De
 
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
Human-Action-Recognition-Understanding-Behavior.pptx
nreddyjanga
 
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
T2_01 Apuntes La Materia.pdfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxskksk
mathiasdasilvabarcia
 
R Cookbook - Processing and Manipulating Geological spatial data with R.pdf
OtnielSimopiaref2
 

Python Function and Looping

  • 2. In Python, a function is a group of related statements that performs a specific task. It help us work faster, simplify our code and avoids repetition.
  • 3. It takes in an input. It does something to that input. It gives back an output. Generally, a function displays this pattern:
  • 5. Built-in functions - Functions that are built into Python. Ex: sum(), max(), etc. User-defined functions - Functions defined by the users themselves. Basically, we can divide functions into the following two types: 1. 2. TYPE OF FUNCTION
  • 6. Python offers us an easy way to repeat a process, which helps us when we need to repeat a process hundreds, thousands, or even millions of times. Let's say we have a list [3, 5, 1, 2] assigned to a variable ratings, and we want to repeat the following process: for each element in ratings, print its index and itself. This is how we could translate that into Python syntax: LOOPING IN PYTHON
  • 7. The technique used previously is called a loop, because we always start with for (like in for some_variable in some_list:), this technique is known as a for loop. STRUCTURE OF LOOPING