Module 3 Functions, Tuples, Dictionaries,
Data processing
Function parameters,
Argument passing
Module 3 Function parameters
& Argument passing
Parameterized functions 1
parameters exist only
inside functions in
which they have been
defined
assigning a value to
the parameter is done
at the time of the
function's invocation
parameters live inside
functions
Module 3 Function parameters
& Argument passing
Parameterized functions 2
def message(number):
print("Enter a number:", number)
message()
TypeError: message() missing 1 required
positional argument: 'number'
def message(number):
print("Enter a number:", number)
message(1)
Enter a number: 1
def message(what, number):
print("Enter", what, "number", number)
message("telephone", 11)
message("price", 5)
message("number", "number")
Enter telephone number 11
Enter price number 5
Enter number number number
Module 3 Function parameters
& Argument passing
Positional parameter passing
def my_function(a, b, c):
print(a, b, c)
my_function(1, 2, 3)
def introduction(first_name, last_name):
print("Hello, my name is", first_name, last_name)
introduction("Luke", "Skywalker")
introduction("Jesse", "Quick")
introduction("Clark", "Kent")
Hello, my name is Luke Skywalker
Hello, my name is Jesse Quick
Hello, my name is Clark Kent
Module 3 Function parameters
& Argument passing
Keyword argument passing
def introduction(first_name, last_name):
print("Hello, my name is", first_name, last_name)
introduction(first_name = "James", last_name = "Bond")
introduction(last_name = "Skywalker", first_name = "Luke")
Module 3 Function parameters
& Argument passing
Mixing positional&keyword arguments
positional arguments before keyword arguments
def adding(a, b, c):
print(a, "+", b, "+", c, "=", a + b + c)
# Call the adding function
• adding(1, 2, 3)
positional
• adding(c = 1, a = 2, b = 3)
keyword
• adding(3, c = 1, b = 2)
mix
Module 3 Function parameters
& Argument passing
Parametrized functions
def introduction(first_name, last_name="Smith"):
print("Hello, my name is", first_name, last_name)
introduction("Henry")
introduction(first_name="William")
introduction("James", "Doe")
def introduction(first_name="John", last_name="Smith"):
print("Hello, my name is", first_name, last_name)
Module 3 Function parameters
& Argument passing
Key takeaways
You can pass information to functions by using
parameters.
You can pass arguments to a function using the
following techniques:
• positional argument passing
• keyword (named) argument passing
• a mix of positional and keyword argument passing
You can use the keyword argument passing
technique to pre-define a value for a given argument.

More Related Content

PDF
Python Functions (PyAtl Beginners Night)
PDF
Functions in python
PPTX
Functions in python3
PDF
Class 7a: Functions
PDF
FUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCE
PDF
Introduction to python
PPT
Oop lecture8
PPTX
Python PCEP Functions And Scopes
Python Functions (PyAtl Beginners Night)
Functions in python
Functions in python3
Class 7a: Functions
FUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCE
Introduction to python
Oop lecture8
Python PCEP Functions And Scopes

What's hot (20)

PPTX
PDF
Python Modules, Packages and Libraries
PPTX
FUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCE
PDF
iRODS Rule Language Cheat Sheet
PPTX
Python programing
PDF
Protocols
PPTX
Pointers in c
PDF
Python Usage (5-minute-summary)
PDF
Python-Tuples
PPTX
Introduction to Python and TensorFlow
PPTX
Python Modules and Libraries
PDF
PPTX
Python Course for Beginners
ODP
Very basic functional design patterns
PPTX
Pragmatic metaprogramming
PDF
The Error of Our Ways
ODP
Python quickstart for programmers: Python Kung Fu
PDF
1 pythonbasic
PDF
The Ring programming language version 1.7 book - Part 35 of 196
PPTX
Python basic
Python Modules, Packages and Libraries
FUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCE
iRODS Rule Language Cheat Sheet
Python programing
Protocols
Pointers in c
Python Usage (5-minute-summary)
Python-Tuples
Introduction to Python and TensorFlow
Python Modules and Libraries
Python Course for Beginners
Very basic functional design patterns
Pragmatic metaprogramming
The Error of Our Ways
Python quickstart for programmers: Python Kung Fu
1 pythonbasic
The Ring programming language version 1.7 book - Part 35 of 196
Python basic
Ad

Similar to Python PCEP Function Parameters (20)

PDF
Chapter Functions for grade 12 computer Science
PPTX
Lecture 08.pptx
PPTX
Python functions PYTHON FUNCTIONS1234567
PPTX
Python Introduction 2 Deep Learning.pptx
PPTX
UNIT- 2 PPDS R20.pptx
PPTX
Python PCEP Functions
PDF
8799.pdfOr else the work is fine only. Lot to learn buddy.... Improve your ba...
PDF
Or else the work is fine only. Lot to learn buddy.... Improve your basics in ...
PDF
PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...
PPT
Function in Python [Autosaved].ppt
PPTX
Python for Data Science function third module ppt.pptx
PPTX
Python 표준 라이브러리
PPT
functions modules and exceptions handlings.ppt
PDF
Notes5
PPTX
Working with functions.pptx. Hb.
PPTX
Viii session
PPTX
Python functions part11
ODP
Python course Day 1
PPTX
CHAPTER 01 FUNCTION in python class 12th.pptx
PDF
The Ring programming language version 1.3 book - Part 13 of 88
Chapter Functions for grade 12 computer Science
Lecture 08.pptx
Python functions PYTHON FUNCTIONS1234567
Python Introduction 2 Deep Learning.pptx
UNIT- 2 PPDS R20.pptx
Python PCEP Functions
8799.pdfOr else the work is fine only. Lot to learn buddy.... Improve your ba...
Or else the work is fine only. Lot to learn buddy.... Improve your basics in ...
PYTHONOr else the work is fine only. Lot to learn buddy.... Improve your basi...
Function in Python [Autosaved].ppt
Python for Data Science function third module ppt.pptx
Python 표준 라이브러리
functions modules and exceptions handlings.ppt
Notes5
Working with functions.pptx. Hb.
Viii session
Python functions part11
Python course Day 1
CHAPTER 01 FUNCTION in python class 12th.pptx
The Ring programming language version 1.3 book - Part 13 of 88
Ad

More from IHTMINSTITUTE (17)

PPTX
Python PCEP Tuples and Dictionaries
PPTX
Python PCEP Tuples and Dictionaries
PPTX
Python PCEP Creating Simple Functions
PPTX
Python PCEP Multidemensional Arrays
PPTX
Python PCEP Operations On Lists
PPTX
Python PCEP Sorting Simple Lists
PPTX
Python PCEP Lists Collections of Data
PPTX
Python PCEP Logic Bit Operations
PPTX
Python PCEP Loops
PPTX
Python PCEP Comparison Operators And Conditional Execution
PPTX
Python PCEP How To Talk To Computer
PPTX
Python PCEP Variables
PPTX
Python PCEP Operators
PPTX
Python PCEP Literals
PPTX
IHTM Python PCEP Hello World
PPTX
IHTM Python PCEP Introduction to Python
PPTX
Python PCEP Welcome Opening
Python PCEP Tuples and Dictionaries
Python PCEP Tuples and Dictionaries
Python PCEP Creating Simple Functions
Python PCEP Multidemensional Arrays
Python PCEP Operations On Lists
Python PCEP Sorting Simple Lists
Python PCEP Lists Collections of Data
Python PCEP Logic Bit Operations
Python PCEP Loops
Python PCEP Comparison Operators And Conditional Execution
Python PCEP How To Talk To Computer
Python PCEP Variables
Python PCEP Operators
Python PCEP Literals
IHTM Python PCEP Hello World
IHTM Python PCEP Introduction to Python
Python PCEP Welcome Opening

Recently uploaded (20)

PDF
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
PPTX
Reading as a good Form of Recreation
PDF
Virtual Guard Technology Provider_ Remote Security Service Solutions.pdf
PPTX
ECO SAFE AI - SUSTAINABLE SAFE AND HOME HUB
PPTX
Tìm hiểu về dịch vụ FTTH - Fiber Optic Access Node
DOCX
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
PPTX
MY PRESENTATION66666666666666666666.pptx
DOCX
Memecoinist Update: Best Meme Coins 2025, Trump Meme Coin Predictions, and th...
PPTX
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
PPTX
Basic understanding of cloud computing one need
PPTX
Artificial_Intelligence_Basics use in our daily life
PPTX
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
PPTX
Concepts of Object Oriented Programming.
PPTX
The-Importance-of-School-Sanitation.pptx
PPTX
在线订购名古屋艺术大学毕业证, buy NUA diploma学历认证失败怎么办
PPTX
最新版美国埃默里大学毕业证(Emory毕业证书)原版定制文凭学历认证
PDF
healthwealthtech4all-blogspot-com-2025-08-top-5-tech-innovations-that-will-ht...
PPT
12 Things That Make People Trust a Website Instantly
PPTX
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
PDF
simpleintnettestmetiaerl for the simple testint
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
Reading as a good Form of Recreation
Virtual Guard Technology Provider_ Remote Security Service Solutions.pdf
ECO SAFE AI - SUSTAINABLE SAFE AND HOME HUB
Tìm hiểu về dịch vụ FTTH - Fiber Optic Access Node
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
MY PRESENTATION66666666666666666666.pptx
Memecoinist Update: Best Meme Coins 2025, Trump Meme Coin Predictions, and th...
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
Basic understanding of cloud computing one need
Artificial_Intelligence_Basics use in our daily life
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
Concepts of Object Oriented Programming.
The-Importance-of-School-Sanitation.pptx
在线订购名古屋艺术大学毕业证, buy NUA diploma学历认证失败怎么办
最新版美国埃默里大学毕业证(Emory毕业证书)原版定制文凭学历认证
healthwealthtech4all-blogspot-com-2025-08-top-5-tech-innovations-that-will-ht...
12 Things That Make People Trust a Website Instantly
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
simpleintnettestmetiaerl for the simple testint

Python PCEP Function Parameters

  • 1. Module 3 Functions, Tuples, Dictionaries, Data processing Function parameters, Argument passing
  • 2. Module 3 Function parameters & Argument passing Parameterized functions 1 parameters exist only inside functions in which they have been defined assigning a value to the parameter is done at the time of the function's invocation parameters live inside functions
  • 3. Module 3 Function parameters & Argument passing Parameterized functions 2 def message(number): print("Enter a number:", number) message() TypeError: message() missing 1 required positional argument: 'number' def message(number): print("Enter a number:", number) message(1) Enter a number: 1 def message(what, number): print("Enter", what, "number", number) message("telephone", 11) message("price", 5) message("number", "number") Enter telephone number 11 Enter price number 5 Enter number number number
  • 4. Module 3 Function parameters & Argument passing Positional parameter passing def my_function(a, b, c): print(a, b, c) my_function(1, 2, 3) def introduction(first_name, last_name): print("Hello, my name is", first_name, last_name) introduction("Luke", "Skywalker") introduction("Jesse", "Quick") introduction("Clark", "Kent") Hello, my name is Luke Skywalker Hello, my name is Jesse Quick Hello, my name is Clark Kent
  • 5. Module 3 Function parameters & Argument passing Keyword argument passing def introduction(first_name, last_name): print("Hello, my name is", first_name, last_name) introduction(first_name = "James", last_name = "Bond") introduction(last_name = "Skywalker", first_name = "Luke")
  • 6. Module 3 Function parameters & Argument passing Mixing positional&keyword arguments positional arguments before keyword arguments def adding(a, b, c): print(a, "+", b, "+", c, "=", a + b + c) # Call the adding function • adding(1, 2, 3) positional • adding(c = 1, a = 2, b = 3) keyword • adding(3, c = 1, b = 2) mix
  • 7. Module 3 Function parameters & Argument passing Parametrized functions def introduction(first_name, last_name="Smith"): print("Hello, my name is", first_name, last_name) introduction("Henry") introduction(first_name="William") introduction("James", "Doe") def introduction(first_name="John", last_name="Smith"): print("Hello, my name is", first_name, last_name)
  • 8. Module 3 Function parameters & Argument passing Key takeaways You can pass information to functions by using parameters. You can pass arguments to a function using the following techniques: • positional argument passing • keyword (named) argument passing • a mix of positional and keyword argument passing You can use the keyword argument passing technique to pre-define a value for a given argument.