Question: 1

Which of the following is an example of an if/else statement scenario?

If it is raining, bring an umbrella.

If it is cold out wear a coat. If it is raining, wear a hat.

If it is raining, bring an umbrella. If not, wear sunglasses.

If it is not cold out, don’t wear a coat.

Question: 2
What is the limit of conditions that can be used in an if/elif/else statement?

1

2

4

unlimited

Question: 3
Which of the following if/else statements using a variable called ‘count’ are written correctly?

if count > 10():
forward(100)
else():
forward(50)

if count > 10:
forward(100)
else:
forward(50)

if (count) > 10:
forward(100)
else:
forward(50)

if count > 10:
forward(100)
else():
forward(50)
Question: 4
What would be the radius of the circle output from the following code?
If Else Statement Image

10 pixels

20 pixels

30 pixels

40 pixels

1 answer

Here are the answers to your questions:

Question 1: Which of the following is an example of an if/else statement scenario?

  • Answer: If it is raining, bring an umbrella. If not, wear sunglasses.

Question 2: What is the limit of conditions that can be used in an if/elif/else statement?

  • Answer: unlimited

Question 3: Which of the following if/else statements using a variable called ‘count’ are written correctly?

  • Answer:
    • if count > 10: forward(100) else: forward(50)

    • if (count) > 10: forward(100) else: forward(50)

Question 4: What would be the radius of the circle output from the following code? (Since the code is not provided, I can't answer this question accurately.)

Please provide the code related to Question 4 for a more accurate answer.