Python – Loops(While Loop)

This article is a continuation of this last post:
https://arjunaraneta.wordpress.com/2014/08/26/python-loopsfor-loop/

The difference is I used a while in this program. The syntax of the for and while loops and different in terms of the codes used but the concept of a block with a starting value, ending value, and a process of increase and decrease are the same.

 

Here is my code.

loop3

 

Your output should be the same as below:
loop2

 

Thank you for reading this post.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s