Star Patterns with Python Loops | Part 4 -Whole Pyramid

preview_player
Показать описание


Follow along with this tutorial to construct a right-half pyramid using Python loops. Subscribe to the channel for more tutorials.
Рекомендации по теме
Комментарии
Автор

another way to solve it is thinking about the math of * and iterator i. for example: we have this pattern of */line: 9, 7, 5, 3, 1. so I think this can be expressed this way:
9 = 10 - [(2 x 0) +1 ] = 10 -1
7 = 10 - [( 2 x 1) +1] = 10 -3
5 = 10 - [(2 x 2) +1] = 10 -5 and so on and so forth. so the formula for counting * is stars = 10 -(2*i +1). the number of spaces = i. this way I can use only 1 for loop = higher efficiency algorithim.

ChristianoSts
Автор

Please tell me how to write code for this:
In first row 1 star is printed and in second row three star is printed
And in third row 5 star is printed

vidhigusain
Автор

what is this i and j? i want to learn but i am unable to understand these things. Daily i am coming from office and sitting infront of the computer trying to understand but i can't

Farazmukadamhee
visit shbcf.ru