Computer Science I

From WLCS
Revision as of 02:12, 6 January 2009 by Admin (talk | contribs)

Tuesday (1/6/09)

Warmup:

  • Assume you have the following code:
i = 0
n = 1
while i < 25:
  n += 2
  i += 1
  • WITHOUT using your computer, what are the final values of i and n?

Agenda:

  • Looping warmup review
  • break keyword
  • Assume you have the following code:
i = 0
n = 1
while i < 25:
  n += 2
  if n > 10:
    break
  i += 1
  • WITHOUT using your computer, what are the final values of i and n?

Archives