

Python Functions - Introduction
Presentation
•
Computers
•
Professional Development
•
Hard
Sandra Eugenia Barajas Montiel
Used 10+ times
FREE Resource
14 Slides • 4 Questions
1
2
3
4
5
Learning Target: I can write my own functions, use them in my code, explain why they make my programs easier to manage, and fix mistakes in function definitions.
6
Yeah
I've been tryna call
I've been on my own for long enough
Maybe you can show me how to love, maybe
I'm goin' through withdrawals
You don't even have to do too much
You can turn me on with just a touch, baby
I look around and
Sin City's cold and empty (oh)
No one's around to judge me (oh)
I can't see clearly when you're gone
I said, ooh, I'm blinded by the lights
No, I can't sleep until I feel your touch
I said, ooh, I'm drowning in the night
Oh, when I'm like this, you're the one I trust
(Hey, hey, hey)
I'm running out of time
'Cause I can see the sun light up the sky
So I hit the road in overdrive, baby, oh
The city's cold and empty (oh)
No one's around to judge me (oh)
I can't see clearly when you're gone
I said, ooh, I'm blinded by the lights
No, I can't sleep until I feel your touch
I said, ooh, I'm drowning in the night
Oh, when I'm like this, you're the one I trust
I'm just walking by to let you know (by to let you know)
I could never say it on the phone (say it on the phone)
Will never let you go this time (ooh)
I said, ooh, I'm blinded by the lights
No, I can't sleep until I feel your touch
(Hey, hey, hey)
(Hey, hey, hey)
I said, ooh, I'm blinded by the lights
No, I can't sleep until I feel your touch
Source: Musixmatch Songwriters: Martin Karl Sandberg / Jason Quenneville / Oscar Thomas Holter / Ahmad Balshe / Abel Tesfaye
7
8
Fill in the Blanks
Functions are really powerful programming constructs because they let us _____ ______
of code
that we have already written. This helps us manage the complexity of our programs because it can
______ the amount of code that we need to write . It also helps make our programs easier to __________
and consequently maintain, because functionality is more clearly separated within our programs.
9
10
11
12
Fill in the Blanks
#COMPLETE THE FUNCTION DEFINITION
def calculate_profit( _ ):
# Calculate the profit using the formula P(x)
profit = (-8* (x ** 2)) + (3200 * x) - 16000
# Return the final calculated profit
return
13
Fill in the Blanks
#COMPLETE THE FUNCTION CALL
apartmentsrented1 = 30
_____________ = calculate_profit(_________________)
print("If",apartmentsrented1," apartments are rented, the profit is: $",profitresult1)
14
Function Requirements
Function Name: calculate_total_cost
Parameters: The function must accept exactly two parameters in the following order:
quantity (an integer representing the number of items).
unit_price (a float representing the cost of one item).
Calculation: The function must return the result of quantity * unit_price.
You are working as a junior developer for "SupplyChain Solutions," a company that provides inventory tracking software to small businesses. A core requirement of their application is the ability to instantly calculate the total cost of any given purchase order.
-The total cost is calculated by multiplying the quantity of items ordered by the unit price of that item.
Your task is to implement a reusable Python function that performs this critical calculation.
15
16
Multiple Choice
The code highlighted in blue is best defined as:
function name
function call
function definition
arguments
parameters
17
18
Show answer
Auto Play
Slide 1 / 18
SLIDE
Similar Resources on Wayground
11 questions
Teenager 5 Session 22: Pronunciation & Speaking
Presentation
•
KG
11 questions
Fractions
Presentation
•
Professional Development
15 questions
Guess the Movie
Presentation
•
KG - Professional Dev...
15 questions
Technology Training
Presentation
•
Professional Development
13 questions
Elementi Base
Presentation
•
Professional Development
12 questions
virtualization and cloud computing-Part 1
Presentation
•
Professional Development
14 questions
EXCEL
Presentation
•
Professional Development
14 questions
Simple Past
Presentation
•
Professional Development
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade