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 24+ times

FREE Resource

21 Slides • 20 Questions

1

media
media
media

2

Open Ended

Question image

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?

4

media
media
media

5

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.

6

media
media
media

8

media
media

9

media

11

Labeling

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

Drag labels to their correct position on the image

Arguments

Returned String Data

Parameters

Function Defined

Returned Integer Data

Function Calls

12

media
media

13

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

14

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

15

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

16

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

17

media

19

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

21

media
media

22

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

23

​

media
media
media
media
media
Code Visualizer

​

media
media
media
media

24

Multiple Choice

Question image

Determine the output of the following code.

1

15

2

20

3

25

4

30

5

Error

25

Multiple Choice

Question image

Determine the output of the following code.

1

9

2

4

3

5

4

None

5

Error

26

Multiple Choice

Question image

Determine the output of the following code.

1

10

2

25

3

0

4

None

5

Error

27

Multiple Choice

Question image

Determine the output of the following code.

1

5

2

7

3

10

4

None

5

Error

28

Multiple Choice

Question image

Determine the output of the following code.

1

6

2

12

3

18

4

None

5

Error

29

Multiple Choice

Question image

Determine the output of the following code.

1

6

2

12

3

18

4

None

5

Error

30

media
media
media
media

31

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

32

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.

33

Multiple Choice

Question image

Determine the output of the following code.

1

5

2

7

3

10

4

None

5

Error

34

Multiple Choice

Question image

Determine the output of the following code.

1

25

2

30

3

35

4

40

5

Error

35

media
media
media
media

36

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 / 41

SLIDE