DEV Community

Cover image for Pythoonzie DAY 10!
Bhartiprof
Bhartiprof

Posted on

Pythoonzie DAY 10!

πŸŽ₯ My Python Learning Vlog3 – Exploring Loops & Pattern Printing

Today I practiced Python loops and pattern printing, and it felt like recording my own little coding vlog. While learning programming, small experiments like these really help in building logic step by step.

I started with simple loops and learned how Python repeats tasks automatically using for and while. Loops are very powerful because they allow us to execute the same instruction multiple times without writing the code again and again.

After practicing basic loops, I moved to something more interesting β€” pattern printing using nested loops. Pattern questions are very useful for improving logical thinking because they teach us how loops interact with each other.

Here is the Python code I used to print a number pattern:

for i in range(6, 1, -1):
    for j in range(1, i):
        print(j, end="")
    print()
Enter fullscreen mode Exit fullscreen mode

When this code runs, Python uses two loops. The outer loop controls how many rows will be printed, while the inner loop controls the numbers printed in each row.

The output looks like this:

12345
1234
123
12
1

Each new row prints one number less than the previous row, which creates a downward pattern. Understanding how the outer loop and inner loop work together made pattern printing much clearer for me.

Practicing small programs like this helps build strong programming logic. Every time I write such code, I feel more confident with Python and more excited to learn advanced concepts.

That’s it for today’s coding vlog. Yeayyy, we'll learn the more topics and printing pattern tommorow.
#python #Day1 #DataScience #bhartiinsan

Top comments (0)