Difference between revisions of "Convert a for loop to a while loop"

From CompSciWiki
Jump to: navigation, search
 
Line 1: Line 1:
 
{{Template:1010ExtraLabs
 
{{Template:1010ExtraLabs
 
|Chapter_TOC=[[Extra Labs]]
 
|Chapter_TOC=[[Extra Labs]]
|Introduction=How are you doing in while and for loops?.
+
|Introduction=In this program, you will be learn how to use while and for loop control structures in Python.
 +
===[[ while and for loops syntax in Python: ]]===
 +
 
 +
while (expression):
 +
  Statement(s)
 +
 
 +
for iterating_var in sequence:
 +
  statements(s)
 +
 
 
|Body=
 
|Body=
  
Line 10: Line 18:
 
}}
 
}}
 
}}
 
}}
 
Bla2.
 

Revision as of 22:59, 3 April 2012

COMP 1010 Home > Back to Extra Labs

Introduction

In this program, you will be learn how to use while and for loop control structures in Python.

while and for loops syntax in Python:

while (expression):

  Statement(s)

for iterating_var in sequence:

  statements(s)

Step 1:

 Bla3;