Kola pulli pattern in python
Hello Makkale!
Inaiku nama pakaporadhu " How to create digital pulli for digital kolam using Python" in other words "How to create pyramid pattern using python "
Language : Python
IDE : Pycharm
Mangalagarama Pycharm la start panrom
Lets dive into the code
In the above code, we have initialized the n variable to enter the number of rows for the pattern. We entered n = 5, the range of outer for loop will be 0 to 4.
- The iteration of the inner for loop depends on the outer loop. The inner loop is responsible to print the number of columns of kolam.
- In the first iteration, the value of i is 0, and it increased by 1, so it becomes 0+1, now inner loop iterated first time and print one kola pulli (*).
- In the second iteration, the value of i is 1 and it increased by 1, so it becomes 1+1, now inner loop iterated two times and print two kola pulli (*).
- The end argument prevents to jump into another line. It will printer the star until the loop is valid.
- The last print statement is responsible for ending the line after each row.
Output
Indha code ah try pani kolam potu jolly ah fun panunga makkale.
Haan we forgot to say,
This is our new blog channel. Here we discuss about small snippets of codes of different programming languages! Enjoy Coding
See u all in another blog post bubye
Comments
Post a Comment