Search Header Logo

Python Programming MP4 EMPA Review Part 2

Authored by Lisa Zaranski

Computers

9th - 12th Grade

Used 2+ times

Python Programming MP4 EMPA Review Part 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

  1. Only one parameter can have a default value given

  1. Any parameters that don’t have default values must come before any parameters that do have default values

  1. Default parameters must be the same type for every parameter

There is nothing wrong with the function

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

  1. Which of the following Python lines contains a valid comment?

  1. def get_name():    # get the user’s name

  1. def get_name():

  1. def  get_name():   ** get the user’s name

def  get_name():   % get the user’s name

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following for loops will loop 12 times?

for i in range(12):

for i in range(1, 12):

for i in range(0, 11):

for i in range(1, 12, 1):

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

2

8

12

20

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Three of the for loops below will provide identical values for i. Which for loop will provide values that do not match the others?

for i in range(0, 5):

for i in range(5):

for i in range(0, 5, 1):

for i in range(5, 0, 1):

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What would you use if you wanted to ask the user for the number of ounces of water he/she drank that day, and then print one of two messages based on the number?

If

While

For

If-else

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

When would a while loop be a better control structure to use than a for loop?

When you need to repeat multiple commands

When you need to repeat something 5 times

When you don’t know how many times something will need to repeat

When the user is inputting how many times to repeat something

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?