Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Shell Scripting Tutorial-51: Nested Loops

32.9K views on YouTube

In this tutorial you’ll learn to use nested loops to print all possible combinations of digits 1, 2 and 3.

I was asked to write this program in an exam I wrote in the second year of my graduation. I remember using three ‘for loops’ then. I got back home and immediately tested the code I wrote in the answer sheet and when I saw the twenty seven numbers on screen, I realized that I wasn’t as dumb as I thought myself to be.