Difference between revisions of "Convert a for loop to a while loop"
From CompSciWiki
Line 1: | Line 1: | ||
{{Template:1010ExtraLabs | {{Template:1010ExtraLabs | ||
|Chapter_TOC=[[Extra Labs]] | |Chapter_TOC=[[Extra Labs]] | ||
− | |Introduction= | + | |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: | ||
}} | }} | ||
}} | }} | ||
− | |||
− |
Revision as of 22:59, 3 April 2012
COMP 1010 Home > Back to Extra Labs
IntroductionIn 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;