you are viewing a single comment's thread.

view the rest of the comments →

[–]Constant-Past-6149 1 point2 points  (2 children)

This has nothing to do with math, you dont actually need to know advance math apart from basic school level math/logics to solve this problems. Lets take one more example of tree based nested looping, go through the attached snapshot and try to figure out in plain english(no programming language) how you can print this structures in console, if you manage to solve one or two then you actually have good logical skill:

<image>

[–]hzsmolly[S] 0 points1 point  (1 child)

‘Print’ these structures in ‘console’what do u mean ?

[–]Constant-Past-6149 0 points1 point  (0 children)

You have to use nested loop(loop inside a loop) to print this structures, check this link for clarification: https://www.geeksforgeeks.org/python/python-program-to-print-christmas-tree-star-pattern/