74.8k views
2 votes
Question 16

0 / 1 pts
For if statements to work in Python you must ____________.
use them with input commands
make decisions about them
indent their code block
add an else to them

Question 12
0.33 / 1 pts
Which of the following are true about algorithms? (You may select more than one)
must output a string
can perform logical operations
produce a result
can be done by a computer

1 Answer

3 votes

Answer:

Question 16

Option C is correct.

For if statements to work in Python you must indent their code block.

In python, if statements are used for decision making. For this purpose, the body o if statement is indented. It tells the compiler where the body starts and where it ends. This means when an if statement is followed by an indent it is if body and which line is non indented, it will be the end of if body.

Question 12

Algorithms:

  • can perform logical operations
  • produce a result
  • can be done by a computer

Basically algorithms are a set of well-defined instructions which are computer applicable and they perform computations to solve problems.

I hope it will help you!

User Pistolshrimp
by
4.9k points