Search Header Logo

Python - MP2 Test

Authored by Allyson Smith

Computers

10th Grade

Used 6+ times

Python - MP2 Test
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to take user input in Python and store it in a variable named `name`?

`name = input("Enter your name: ")`

`input("Enter your name: ") = name`

`name = input()`

`input() = name`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid conditional statement in Python?

if x = 5:

if x == 5:

if (x == 5)

if x := 5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following code?

`Smaller`

`Greater`

`Error`

`None`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

How many times will the following loop execute?

1

2

3

4

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code?

1 2 3 4

0 1 2 3 4

1 2 3 4 5

0 1 2 3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following code?

15

5

Error

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of an extended for loop in Python?

`for i in range(10):`

`for i in range(0, 10, 2):`

`for i in [1, 2, 3]:`

`for i in "hello":`

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?