Search Header Logo

M2.3: SAQ

Authored by Parker Gaston

Other

University

Used 1+ times

M2.3: SAQ
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

19 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The condition in an if statement may be a(n) _________ .

 Boolean variable

boolean expression

 Compound Boolean expression

 All of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The statements inside an if must be indented using tabs.

True

False

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

An if statement must always have an accompanying else.

 

True

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Another name for an if statement is a selection statement.

True

False

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which Python statement is used to simplify tail nesting code?

else

elif

 

if-else

 

tail

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is displayed by the following code?

a = 5

b = 6

c = 7

d = 8


if a <= 5:

  if b > 7:

    print(c)

  else:

    print(d)

else:

  if b < 7:

    print(2 * c)

  else:

    print(2 * d)

7

8

14

16

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

a = 3

b = 5

c = 7

d = 9


if a >= 5:

  if b > 7:

    print(c)

  else:

    print(d)

else:

  if b < 7:

    print(2 * c)

  else:

    print(2 * d)

7

8

14

16

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?