Search Header Logo

Complex if statements

Authored by Barbara Anderson

Computers

9th - 12th Grade

Used 2+ times

Complex if statements
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is optional in an if statement?

if

:

else

Comparison statement

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many else's can you have in an if statement?

one

as many as needed

several

none

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you know which if an else goes with?

It goes with the one with the same comparison statement

It goes with the first if in the program

It goes with the if directly above it

It goes with the if with the same name

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When does an if statement's body run?

When it is next in the code sequence

When the comparison statement returns True

When the comparison statement returns False

After an else

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

X=5

y=5

Which checks to see if x and y are the same in an if statement?

x=y

x equals y

x!=y

x==y

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When should you use an elif statement?

When checking two outcomes

When checking one outcome

When checking more than two outcomes

When you want to run two difference scenarios

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which comparison operator checks to see if two variables are not equal?

<>

NOT=

>=

!=

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?