Computer Science, asked by hariom3221, 5 months ago

Which of the following is False regarding loops in Python?
Loops are used to perform certain tasks repeatedly.
While loop is used when multiple statements are to executed repeatedly until the given condition becomes False
While loop is used when multiple statements are to executed repeatedly until the given condition becomes True.
for loop can be used to iterate through the elements of lists.

Answers

Answered by Anonymous
2

while loop is executed once before the condition is checked. Its syntax is: do { // body of loop; } while (condition); ... If the condition evaluates to true , the body of the loop inside the do statement is executed again.

Answered by pruthaasl
1

Answer:

The incorrect statement regarding loops in Python is c) While loop is used when multiple statements are to be executed repeatedly until the given condition becomes true.

Explanation:

  • The while loop is used to repeat a part of the code when a particular condition is satisfied.
  • After every iteration, the condition is checked again.
  • The while loop is terminated only when the condition is not satisfied.

Hence, the statement 'while loop is used when multiple statements are to be executed repeatedly until the given condition becomes true is wrong.

Explanation for incorrect options:

a)Loops are used to perform certain tasks repeatedly.

  • Loops are used when a certain portion of the code is to be repeated several times.
  • There are various loops available in Python. They are for loop, while loop, do-while loop, and if-else loop.

b) While loop is used when multiple statements are to be executed repeatedly until the given condition becomes false.

  • The while loop is terminated only when the condition is not satisfied.

d) For loop can be used to iterate through the elements of the lists.

  • The for loop is used to iterate over a sequence or objects.
  • It is used to iterate over the elements of a list.

#SPJ3

Similar questions