Search Header Logo

[AP CSP] Python Coding: Conditionals + List + Algo Dev

Authored by Tommy Nguyen

Computers

9th - 12th Grade

Used 3+ times

[AP CSP] Python Coding: Conditionals + List + Algo Dev
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

18 questions

Show all answers

1.

FILL IN THE BLANKS QUESTION

5 mins • 1 pt

Media Image

A game tracks three energy readings.

What is the exact output?

​ (a)  

Answer explanation

Media Image

The outer condition, 18 < 31, is True, so execution enters the first branch. Within that branch, 18 > 12 is also True, so signal becomes 31 - 12, or 19. The other branches are skipped, and print displays 19.

2.

FILL IN THE BLANKS QUESTION

5 mins • 1 pt

Media Image

A game tracks three energy readings.

What is the exact output?

​ (a)  

Answer explanation

Media Image

The outer comparison, 42 <= 26, is False, so the outer else branch runs. Its nested comparison, 26 < 17, is False as well, assigning "Hold" to status. The arithmetic assignments are never reached, and the output is Hold without quotation marks.

3.

MULTIPLE SELECT QUESTION

5 mins • 1 pt

Each option is a separate program.

Select ALL options that print 👉 Standard.

Media Image
Media Image
Media Image
Media Image

Answer explanation

Media Image

A prints Standard because 48 >= 20 is the first True condition; Python does not continue to the later elif.

B skips 48 > 70 and prints Standard because 48 >= 45 is True.

C prints Boost because its first condition is already True.

D prints Low because 48 > 48 is False and 48 >= 20 is True.

4.

MULTIPLE SELECT QUESTION

5 mins • 1 pt

Each option is a separate program.

Select ALL options that print 👉 Express.

Media Image
Media Image
Media Image
Media Image

Answer explanation

Media Image

A prints Regular because 30 >= 30 is True, preventing the elif from running.

B prints Express at its inclusive <= 30 boundary.

C reaches the else because both 30 > 45 and 30 < 30 are False.

D prints Express at the first condition, even though its later condition would also be True.

5.

DROPDOWN QUESTION

5 mins • 1 pt

Media Image

Write True or False for each of the six print statements, in order.

​ (a)  

(b)  

​ (c)  

​ (d)  

​ (e)  

True
False

Answer explanation

Media Image

Index 4 is the space in "Nova Reed", index 1 is lowercase "o", and index -1 is the final "d", producing True, False, and True.

Multiplication occurs before subtraction, so 47 - 3.0 * 10 is 17.0, which is <= 17.

Both parts of the or expression are False because is_ready is True.

Finally, 3.0 % 2 and 47 % 2 are both 1, so both != 0 comparisons are True and the and expression is True.

6.

DROPDOWN QUESTION

5 mins • 1 pt

Media Image

Write True or False for each of the six print statements, in order.

​ (a)  

(b)  

​ (c)  

​ (d)  

​ (e)  

True
False

Answer explanation

Media Image

Index 5 contains uppercase "C", which does not equal lowercase "c"; index 2 is "l"; and index -2 is "e", not "n".

The arithmetic expression equals 22.0, so the strict comparison < 22 is False.

Since is_open is False, is_open != True is True and makes the or expression True.

Both 4.0 and 62 have remainder 0 when divided by 2, so the final and expression is True.

7.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Media Image

What will this drone readiness program display?

Grounded

Test Flight

ValueError

Short Flight

Long Flight

Answer explanation

Media Image

The first condition is False because 82 is below 90. The next condition is True: although 82 >= 85 is False, warnings == 0 is True, and an or needs only one True operand. The program prints Short Flight and skips the remaining branches. The maintenance value does not prevent this earlier branch from running.

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?