BORING EDUCATION — NOW LIVEClass 9 and Class 10 full courses are open.Chapter 1 of every subject is free. Unlock the rest with EasyPaisa in minutes.
BORINGEDUCATION

4.2.4

Class 10 Computer ScienceNested loops

Nested loops (4.2.4) is a Class 10 Computer Science lesson for the Punjab boards. It walks through the idea in plain steps, then sets a short check, in English, Urdu or Roman Urdu.

Your guide: Miss HiraExplains computers with chai, cricket and your phone.

This lesson is part of the full course

Chapter 1 of every subject is free. Unlock every chapter of this class with the full course.

Unlock full course

Already paid? Sign in with the Google account you paid with.

Nested loops

A nested loop is a loop inside another loop. For every pass of the outer loop, the inner loop runs completely.

for i in range(3): for j in range(4) prints 12 pairs, from i=0, j=0 to i=2, j=3. The total number of inner passes is outer × inner = 3 × 4.

Patterns use the outer loop for rows and the inner loop for columns: print("*", end=" ") inside, and an empty print() after each row to start a new line.

Total inner runs = outer passes × inner passes.

Step 1 / 1

Finish

Notes, short questions and MCQs

Read the full notes: key terms, model answers and MCQs with answers

Nested loops

A nested loop is a loop inside another loop. For every pass of the outer loop, the inner loop runs completely.

for i in range(3): for j in range(4) prints 12 pairs, from i=0, j=0 to i=2, j=3. The total number of inner passes is outer × inner = 3 × 4.

Patterns use the outer loop for rows and the inner loop for columns: print("*", end=" ") inside, and an empty print() after each row to start a new line.

Total inner runs = outer passes × inner passes.

Before you start

What is Nested loops (4.2.4) in Class 10 Computer Science?
Nested loops (4.2.4) is one Class 10 Computer Science lesson. It walks through the idea in plain steps, then sets a short check. You can read it in English, Urdu or Roman Urdu.
Which boards use this Class 10 Computer Science lesson?
Students on the Punjab boards use the same textbook: Lahore, Rawalpindi, Gujranwala, Faisalabad, Multan, Sargodha, Bahawalpur, Dera Ghazi Khan, Sahiwal. This page does not speak for a board.
Is the check a past paper?
No. The check is practice we wrote. It is not a past paper and it is not a copy of the book.

Found a mistake? Tell us the lesson and the line at exciting@boringeducation.com.

No ads. Tell us what to fix.