Search Header Logo

CodeHS Python Chapter 2

Authored by Greg Baker

Computers

10th - 12th Grade

Used 39+ times

CodeHS Python Chapter 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose you write a function. How many times can you call the function in your code?

Once

Not more than the number of commands the function holds

It depends on the function

As many times as you want

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In which of the following situations would it be best to make a function?

You want Tracy to draw a blue line, and your program requires lots of blue lines.

You need Tracy to move forward by 100.

You need Tracy to turn right and then turn left.

You need to change Tracy’s color.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the statements below is true about indentation in Python?

Indentation only matters in for loops. Then, everything must be indented one level.

Indentation never matters in Python. You can align your code any way you like, but indentation makes your code easier to read.

Indentation always matters in Python. Every statement must be aligned correctly.

Indentation only matters in functions. Then, everything must be indented one level.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a purpose of using functions?

Functions let Tracy do new things.

Functions help group statements together to make your code more readable.

Functions let you execute code a fixed number of times.

Functions allow the programmer to reuse code.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between defining and calling a function?

Defining a function means you are teaching the computer a new word. Calling a function means you are commanding the computer to complete defined actions.

There is no difference.

Calling a function means you are teaching the computer a new word. Defining a function means you are commanding the computer to complete defined actions.

Defining a function must be done each time you want to use the function. Calling a function can only happen once in your code.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following commands can be used to turn Tracy to face North if she is initially facing South?

left(90)

right(180)

left(180)

left(360)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What shape will be drawn with the following command?

circle(50, 360, 3)

(careful)

A circle

A hexagon

A triangle

A diamond

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?