DAY  6(CODE INFINITY)

Before starting  I would like  to tell you'll that you  can give your reviews about this in the comment section and if you like reading my blogs you can follow me , this will notify you about my blog . Today's topic is while loop as we have discussed for loop earlier like for loop it also has very simple syntax :

i=0

while i in range(5):

print(i)

i=i+1

This is  simple example of while loop we can also use while loop with conditional expressions like if , else, elif etc.  which we cover in coming blogs. We can also print table of 5 using while loop  code of this also given below in the screenshot.  

Screenshot of repel which shows how the above code gives output:

Use of while loop

If you find this screenshot blur double tap on it , it will open in another window.

Link of repel:

https://replit.com/@shwetaantil97/While-Loops-1




 

Comments

Lusia said…
Already following

Popular posts from this blog