QuestionQ166

VerifiedControl Flow – Conditional Blocks and Loops

Drag the conditional expressions to create code that displays ** on the screen. Some code boxes will remain unused.

Drag & Drop
pool = 42 - 1 // 2
if :
    print("*")
elif :
    print("**")
else:
    print("***")
Explanation

1 // 2 evaluates to 0, so pool is 42. The first condition, pool < 0, is false; the elif condition, pool > 0, is true, causing print("**") to run.

Community Discussion

No comments yet. Be the first to start the discussion!