Readings

The readings for Tuesday, September 20 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 using a return statement and using a print statement at the end of a function?

  2. What is the result of the following Python code:

    x = 0
    def increment(x):
        x = x + 1
        return x
    
    print x
    print increment(x)
    print x
    print increment(x)
    

    Explain what is happening at each print statement and what the output of each print statement is.

    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 reading04/README.md file in your GitLab repository.