
[AP CSP] Python Coding: Functions, Parameters, Return
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Easy
Tommy Nguyen
Used 24+ times
FREE Resource
21 Slides • 20 Questions
1
2
Open Ended
Ron Weasely traced this code and got the ouput👉BUZZ, which is incorrect.
Describe the potential mistake Ron might have made while tracing this code?
3
4
5
Open Ended
🔗👉
🔍As we step through the code in Python Visualizer, describe....
💭 What you noticed about how Python is tracing through the code (follow the red arrow)
💬 Describe in you own words, how you think the FUNCTIONS work in this code.
6
7
8
9
10
11
Labeling
🏷️Label the appropriate parts of the 💻 code shown.
Arguments
Returned String Data
Parameters
Function Defined
Returned Integer Data
Function Calls
12
13
Multiple Select
Which line(s) of code calls a user-defined function?
line 38
line 39
line 41
line 42
line 43
14
Multiple Select
Which line(s) of code calls a function?
line 16
line 10
line 11
line 17
line 12
15
Match
Match each code with their corresponding term.
final_checkout(tax_rate)
qty
0.06
cost
final_checkout(0.06)
function defined
parameter
argument
variable to store returned data
function call
function defined
parameter
argument
variable to store returned data
function call
16
Match
Match each code with their corresponding term.
clueFive(THINGS)
THINGS
itemsList
item_clue
clueFive(itemsList)
function defined
parameter
argument
variable to store returned data
function call
function defined
parameter
argument
variable to store returned data
function call
17
18
19
Categorize
function 1️⃣
function 2️⃣
function 3️⃣
function 4️⃣
function 5️⃣
function 6️⃣
function 7️⃣
function 8️⃣
Categorize the Type of Functions the corresponding categories.
20
21
22
Categorize
buyer_name
base_price
tax_rate
total_cost
final_message
shipping_fee
final_price
greeting
receipt_text
Classify the Variables form the code as Global or Local.
23
24
Multiple Choice
Determine the output of the following code.
15
20
25
30
Error
25
Multiple Choice
Determine the output of the following code.
9
4
5
None
Error
26
Multiple Choice
Determine the output of the following code.
10
25
0
None
Error
27
Multiple Choice
Determine the output of the following code.
5
7
10
None
Error
28
Multiple Choice
Determine the output of the following code.
6
12
18
None
Error
29
Multiple Choice
Determine the output of the following code.
6
12
18
None
Error
30
31
Multiple Choice
Which line of code does one function call the other function?
Line 315
Line 318
Line 322
Line 319
None
32
Multiple Choice
The following code produces an error.
What is the cause of this error?
The function does not have a return statement.
You cannot divide parameters by each other.
The main code is trying to access a local variable, speed.
The function call is missing arguments.
The variable distance is a string instead of an integer.
33
Multiple Choice
Determine the output of the following code.
5
7
10
None
Error
34
Multiple Choice
Determine the output of the following code.
25
30
35
40
Error
35
36
Poll
After 3 weeks of Python Programming...
How do we currently FEEL ABOUT CODING?? 😅💭
I LOVE 💻CODING!!
It's more 😰challenging than I thought
...Low Key...
I almost 😅resorted to using Ai sometimes
I feel like I'm improving😊👍
I NEVER want to Code Again 😭
38
40
Show answer
Auto Play
Slide 1 / 41
SLIDE
Popular Resources on Wayground
10 questions
How much do you know about our Portrait of an Eagle?
Quiz
•
10th Grade
10 questions
Fast Food Slogans
Quiz
•
6th - 8th 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