LinkedIn Python Skill Assessment Quiz Answers

When does a for loop stop iterating?

Latest Update on 25th January, 2022 by Certification Course Answers

When does a for loop stop iterating?

  1.  when it encounters an infinite loop
  2.  when it encounters an if/else statement that contains a break keyword
  3.  when it has assessed each item in the iterable it is working on or a break keyword is encountered
  4.  when the runtime for the loop exceeds O(n^2)

Correct Answer:

  •  when it has assessed each item in the iterable it is working on or a break keyword is encountered

Latest Updates

No posts found in this category.