Search Header Logo
[AP CSP] Python Coding: Functions, Parameters, Return

[AP CSP] Python Coding: Functions, Parameters, Return

Assessment

Presentation

•

Computers

•

9th - 12th Grade

•

Practice Problem

•

Easy

Created by

Tommy Nguyen

Used 26+ times

FREE Resource

21 Slides • 19 Questions

1

media
media
media

2

media
media
media

3

Open Ended

Question image

🔗👉

https://tinyurl.com/3f46thsr

🔍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.

4

media
media
media

6

media
media

7

media

9

Labeling

🏷️Label the appropriate parts of the 💻 code shown.

Drag labels to their correct position on the image

Function Calls

Function Defined

Returned String Data

Returned Integer Data

Parameters

Arguments

10

media
media

11

Multiple Select

Question image

Which line(s) of code calls a user-defined function?

1

line 38

2

line 39

3

line 41

4

line 42

5

line 43

12

Multiple Select

Question image

Which line(s) of code calls a function?

1

line 16

2

line 10

3

line 11

4

line 17

5

line 12

13

Match

Question image

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

14

Match

Question image

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

15

media

17

Categorize

Options (8)
Question image

function 1️⃣

Question image

function 2️⃣

Question image

function 3️⃣

Question image

function 4️⃣

Question image

function 5️⃣

Question image

function 6️⃣

Question image

function 7️⃣

Question image

function 8️⃣

Question image

Categorize the Type of Functions the corresponding categories.

Procedure with No Parameters
Procedure with 1 Parameter
Function with 1 Parameter
Function with 2 Paremeters

19

media
media

20

Categorize

Options (9)

buyer_name

base_price

tax_rate

total_cost

final_message

shipping_fee

final_price

greeting

receipt_text

Question image

Classify the Variables form the code as Global or Local.

Global Variable
Local Variable

21

​

media
media
media
media
media
Code Visualizer

​

media
media
media
media

22

Multiple Choice

Question image

Determine the output of the following code.

1

15

2

20

3

25

4

30

5

Error

23

Multiple Choice

Question image

Determine the output of the following code.

1

9

2

4

3

5

4

None

5

Error

24

Multiple Choice

Question image

Determine the output of the following code.

1

10

2

25

3

0

4

None

5

Error

25

Multiple Choice

Question image

Determine the output of the following code.

1

5

2

7

3

10

4

None

5

Error

26

Multiple Choice

Question image

Determine the output of the following code.

1

6

2

12

3

18

4

None

5

Error

27

Multiple Choice

Question image

Determine the output of the following code.

1

6

2

12

3

18

4

None

5

Error

28

media
media
media
media

29

Multiple Choice

Question image

Which line of code does one function call the other function?

1

Line 315

2

Line 318

3

Line 322

4

Line 319

5

None

30

Multiple Choice

Question image

The following code produces an error.

What is the cause of this error?

1

The function does not have a return statement.

2

You cannot divide parameters by each other.

3

The main code is trying to access a local variable, speed.

4

The function call is missing arguments.

5

The variable distance is a string instead of an integer.

31

Multiple Choice

Question image

Determine the output of the following code.

1

5

2

7

3

10

4

None

5

Error

32

Multiple Choice

Question image

Determine the output of the following code.

1

25

2

30

3

35

4

40

5

Error

33

media
media
media
media

35

Poll

Question image

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 😭

pattern-tertiary
media
media
media

Show answer

Auto Play

Slide 1 / 40

SLIDE