QuestionQ147

VerifiedControl Flow – Conditional Blocks and Loops

How many asterisks (*) does the following code print to the screen?

Question Image

Explanation

In Python, 1 == True evaluates to True, while 1 == False evaluates to False. The code therefore prints one asterisk in the first conditional and two in the second, for a total of three asterisks.

Community Discussion

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