Computer Science 1
CPSC 1301
Syllabus
Calendar
Misc.
Loops Introduction Exercises
With your neighbor, determine what is displayed (if anything) when the following code is interpreted:
startNum =
10
for
num
in
range
(startNum,
0
, -
1
):
print
( num,
"
...
"
)
print
( num,
"
!
"
, sep=
''
)
With your neighbor, identify the following and how they relate to the the code above:
Loop variable
Loop body
Iteration(s)
Draw a flowchart for a generic
for
loop.
flowchart