Readings

The readings for Tuesday, September 13 are:

  1. Automate the Boring Stuff with Python

  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 < 9:
        total + n
    print total
    

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

Notebook Hangs

If your notebook ends up hanging for whatever reason, then try to reset it by going to Kernel and then Interrupt. If that fails, try Kernel and then Restart. If that also fails, then you will need to shutdown Jupyter and restart it.

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 GitLab repository.