Week 2

Learning Objectives

(color key: Python/Programming NLP/CL Software Engineering)

Reading

The readings for this week come from the official Python tutorial. The topic is “Using Python as a Calculator”, but it is a good introduction to numbers, strings, and lists.

Additionally, please read the section on sets (only this section, not the rest of the chapter):

It helps to play with a Python interpreter while reading. Open up Visual Studio Code’s terminal and start Python (e.g., run python3 or py at the command prompt), then try out the examples for yourself.

Testing Your Knowledge

There are two methods not mentioned in the tutorial:

Given the following string:

s = ('There are seven days, there are seven days, '
     'there are seven days in a week. '
     'Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday')

Try to answer the following questions: