1. Home
  2. Data Science
  3. Python
  4. Which of the following statements is true about nested…

Added 10 Feb 2024

Which of the following statements is true about nested loops in Python?

  1. They are not allowed in Python
  2. They are used to define recursive functions
  3. They are loops within other loops Correct answer
  4. They can only contain 'for' loops

Correct answer

C. They are loops within other loops

21 views

MCQSEXAM

Explanation

Nested loops in Python refer to loops that are defined within other loops. They are useful for iterating over multiple levels of data structures such as lists of lists or matrices.

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs