Unit 2 Test (Functions Python Review)

Unit 2 Test (Functions Python Review)

8th - 12th Grade

11 Qs

quiz-placeholder

Similar activities

CSC401_FSKS 4.1 to 4.10

CSC401_FSKS 4.1 to 4.10

9th Grade

11 Qs

conditional constructs in Java

conditional constructs in Java

10th Grade

10 Qs

if - else - elif

if - else - elif

7th - 11th Grade

13 Qs

Python IF Statements

Python IF Statements

9th - 12th Grade

10 Qs

Y9 Python Inputs

Y9 Python Inputs

9th Grade

10 Qs

J277 Programming - Data Types

J277 Programming - Data Types

9th - 11th Grade

11 Qs

Chapter 8 String Manipulations

Chapter 8 String Manipulations

12th Grade

15 Qs

If Elif Else

If Elif Else

8th Grade

10 Qs

Unit 2 Test (Functions Python Review)

Unit 2 Test (Functions Python Review)

Assessment

Quiz

Computers

8th - 12th Grade

Medium

Created by

Antonio Leon

Used 28+ times

FREE Resource

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

5 mins • 8 pts

Media Image

llama

llama

llama

llama llama llama

llama, llama, llama

No output due to an error

Answer explanation

Commas add a space and one print statement will print sideways on the same line.

2.

MULTIPLE CHOICE QUESTION

5 mins • 5 pts

Media Image

120

120.0

15

No output due to an error

Answer explanation

When the function is called, the inputs are 4, 5, and 6. The function tells us to multiply them together. Which yields 120. No decimal point since no single slash division was taking place.

3.

MULTIPLE CHOICE QUESTION

5 mins • 5 pts

Media Image

1.667

2.0

1

No output due to an error

Answer explanation

When function is called, be careful of the order of the inputs. DeltaX and then Delta Y so the inputs are 6 and 10.0 respectively. And then we divide Deltay by DeltaX. Which yields 1.667.

4.

MULTIPLE CHOICE QUESTION

5 mins • 5 pts

Media Image

25.0

25

10

10.0

No output due to an error

Answer explanation

This function takes in an input and returns that input times itself (squared). The input is 5 when called, so the returned answer is 25.

5.

MULTIPLE CHOICE QUESTION

5 mins • 5 pts

Media Image

x is

1

and y is

2

x is, 1, and y is, 2

x is 1 and y is 2

x is1and y is2

No ouptut due to an error

Answer explanation

Commas add a space when connecting pieces of the print statement. One print statement prints sideways on one line.

6.

MULTIPLE CHOICE QUESTION

5 mins • 5 pts

Media Image

17.0

17

42.0

42

No output due to an error

Answer explanation

Remember order of operations. a/b yields 5.0. And c*d yields 12. 5.0+12 in the end is 17.0. The single slash division gives you a decimal, and it stays with the problem until the end.

7.

MULTIPLE CHOICE QUESTION

5 mins • 5 pts

Media Image

27.65

-27.65

0.49

.65

No output due to an error.

Answer explanation

The function is called, but the no inputs are within the parentheses. Despite us knowing what is going on, python does not and doesn't relate outside variables to the function unless typed in as inputs. getChange(price, paid) would give us our intended answer.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?