Readings

The readings for Tuesday, September 15 are:

  1. Automate the Boring Stuff with Python

    Read the rest of the chapter

  2. Python for Informatics: Exploring Information

Questions

Once you have completed these readings, please answer the following questions:

  1. What is the difference between a while loop and a for loop? When would you use one over the other?

  2. Given the following Python code, identify any errors, explain what is wrong, and then fix the problems.

    # Print the sum of the integers 0 through 9 using a while loop
    n = 0
    total = 0
    while n < 10:
        total + n
    print total
    

    Hint: Trace through the code using the Online Python Tutor.

Feedback

If you have any questions, comments, or concerns regarding the course, please provide your feedback here.

Submission

To submit your response, please edit the reading03/README.md file in your Bitbucket repository.