Day 16 of documentating my learning journey

What I learnt Today

1.Learnt while loops and how to impliment them.

On what I Learnt

While loops are a bit different from for loops as one has to create an initializer.

And in a while loop the condition at 1st has to be true so it can print a certa…


This content originally appeared on DEV Community and was authored by James Kabuga

What I learnt Today

1.Learnt while loops and how to impliment them.

On what I Learnt

While loops are a bit different from for loops as one has to create an initializer.

And in a while loop the condition at 1st has to be true so it can print a certain statement.

Also in a while loop it can be used when we don't know the number of times we want to iterate.

At the end we have to specify if we want to increment or decrement depending on what we want to achieve.

We apply incrementation or decrementation by reassigning the varible.

Syntax for a while-loop:

Count =0
while condition:
Do sth
Count += 1 or Count -= 1

Count =0 is the initalizer
Count +=1 is reassigning the variable.

I wrote a python script that prints even numbers between 1 and 20

Resources I used

A python refresher series by Bonaventure Ogeto

Github for documentating my learning journey in python.

What's Next

Tomorrow I'll learn how to impliment break and continue statements


This content originally appeared on DEV Community and was authored by James Kabuga


Print Share Comment Cite Upload Translate Updates
APA

James Kabuga | Sciencx (2025-10-26T21:44:34+00:00) Day 16 of documentating my learning journey. Retrieved from https://www.scien.cx/2025/10/26/day-16-of-documentating-my-learning-journey/

MLA
" » Day 16 of documentating my learning journey." James Kabuga | Sciencx - Sunday October 26, 2025, https://www.scien.cx/2025/10/26/day-16-of-documentating-my-learning-journey/
HARVARD
James Kabuga | Sciencx Sunday October 26, 2025 » Day 16 of documentating my learning journey., viewed ,<https://www.scien.cx/2025/10/26/day-16-of-documentating-my-learning-journey/>
VANCOUVER
James Kabuga | Sciencx - » Day 16 of documentating my learning journey. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/26/day-16-of-documentating-my-learning-journey/
CHICAGO
" » Day 16 of documentating my learning journey." James Kabuga | Sciencx - Accessed . https://www.scien.cx/2025/10/26/day-16-of-documentating-my-learning-journey/
IEEE
" » Day 16 of documentating my learning journey." James Kabuga | Sciencx [Online]. Available: https://www.scien.cx/2025/10/26/day-16-of-documentating-my-learning-journey/. [Accessed: ]
rf:citation
» Day 16 of documentating my learning journey | James Kabuga | Sciencx | https://www.scien.cx/2025/10/26/day-16-of-documentating-my-learning-journey/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.