CDAT - Computer Science‎ > ‎2015-16‎ > ‎CSP‎ > ‎News and Assignments‎ > ‎

16-17 SEP

posted Sep 15, 2015, 11:48 AM by Tom Culpepper   [ updated Sep 16, 2015, 7:37 AM ]
Today we'll start with tracing some code.  Consider the two loops below...
# Loop 1                                                #Loop 2
count = 0                                                number = 0
while count < 10:                                   while number < 10:
  count = count + 1                                   print number
  print count                                              number = number +1

Is there any difference between these two pieces of code?  What would be printed to the screen in each case?

We have a quiz at the end of class today.  It covers while loops.  

Agenda:
1)  Go over solution to tracing problem above
2)  How to index strings
3)  Work on code academy
4)  quiz (last 20 minutes)
Comments