Search Header Logo

Python If Statements Quiz

Authored by Mr Lucas

Computers

9th Grade

Used 41+ times

Python If Statements Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the double equals (==) operator signify in Python?

Assignment

Is equal to

Greater than

Less than

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What must follow an if statement in Python?

A semicolon

A period

A colon

A comma

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the elif statement?

To end a program

To check another condition if the previous one was false

To declare a variable

To start a loop

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for an else statement?

else

:else

else:

else then

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is nesting in programming?

Using multiple variables

Using loops

Placing one if statement inside another

Writing comments in code

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to check if two values are not equal?

==

!=

>=

<=

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print if the input is 'no'? if answer == 'yes': print('It's chilly!') elif answer == 'no': print('It's hot!')

It's chilly!

It's hot!

I'm not sure what you mean.

Nothing

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?