Changes between Version 40 and Version 41 of ControlSystems/SoftwareTeam/IntroToPython


Ignore:
Timestamp:
Sep 4, 2017, 6:50:24 PM (8 years ago)
Author:
cdelgigante
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/IntroToPython

    v40 v41  
    140140   print ("The count is:", count)
    141141   count = count + 1
    142    count = count + 1
     142   count = count + 1 # Yup, lets do it again because we're E-VIL
    143143
    144144print("Good bye!")
     
    149149
    150150}}}
    151 Oh no, I'm tired, so I'm not going to tell you the answer for this one. You should be seeing a pattern by now.  You tell me---What should it print?    Count starts out at 0, and as long as count is less than 9 it will run the code in the block, then it will print "Good bye!".   What else does it print out?
     151Oh no, I'm tired, so I'm not going to tell you the answer for this one. You should be seeing a pattern by now.  You tell me---what should it print?    Count starts out at 0, and as long as count is less than 9 it will run the code in the block, then it will print "Good bye!".   What else does it print out?
    152152
    153153== Bringing it all Together... ==
     
    165165print("score!")
    166166}}}
    167 What does it output?   See how the indenting works when nesting?  Note that count+=1 is shorthand for count=count+1 because not typing those excess characters __could save your life__.
     167What does it output?   See how the indenting works when nesting?  Note that `count+=1` is shorthand for `count=count+1` because not typing those excess characters __could save your life__.
    168168
    169169Now, modify the code to make it repeat the word potato each time based on the current value of count.  For example: