Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Triangle Collection Revisited | Loops
Python Ninja
SectionΒ 4. ChapterΒ 11
ninja.py

ninja.py

bookTriangle Collection Revisited

Swipe to show menu

You have already seen how nested loops help solve problems with repeating patterns. So far, you have used nested for loops when the number of repetitions was known in advance.

But in some Ninja game tasks, the number of repetitions depends on what is happening in the game, not on a fixed number. That is where nested while loops are useful.

Task

Swipe to start coding

Solution

Explore other courses in Catalog

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 11
ninja.py

ninja.py

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt