Changes between Version 47 and Version 48 of ControlSystems/SoftwareTeam/IntroToPython


Ignore:
Timestamp:
Sep 4, 2017, 7:00:10 PM (8 years ago)
Author:
cdelgigante
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/IntroToPython

    v47 v48  
    152152Oh 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?
    153153
    154 == Compound Control Structures:  Here a Control Structure, There a Control Structure, Everywhere a Control Structure... ==
     154== Compound Control Structures:  Here a Control Structure, There a Control Structure, Everywhere a Control Structure... ==
    155155Lastly, you can combine all three of these in any sort of combination, and nest them.  This is how you do real work in a program.   For example, try running this one:
    156156
     
    166166print("score!")
    167167}}}
    168 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__.
     168What does it output?   See how the indenting works when nesting?  Note that `count+=1` is shorthand for `count=count+1` because not typing those extra characters __could save your life__.
    169169
    170170Now, modify the code to make it repeat the word potato each time based on the current value of count, and run it.  When you're done, the output should look like: