Search Header Logo

Understanding Python Basics Quiz

Authored by Sam Berry

Social Studies

9th Grade

Used 1+ times

Understanding Python Basics Quiz
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

What is the correct way to assign the value `10` to a variable called `score` in Python?

score == 10

10 = score

score = 10

score := 10

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid variable name in Python?

2score

my score

my_score

my-score

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `==` operator do in Python?

Assigns a value to a variable

Checks whether two values are equal

Adds two values together

Declares a new variable

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following comparison operators means "not equal to" in Python?

><

=/=

!=

<>

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used in Python to handle an alternative condition after an `if` statement, but before a final `else`?

elseif

elif

else if

otherwise

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value of `x` after the following code runs? ```python x = 5 x = x + 3 ```

5

3

8

53

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? ```python temperature = 20 if temperature > 25: print("Hot") else: print("Cool") ```

Hot

Cool

temperature

Nothing is printed

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?