CS 115 Lab 6: Setup and Practice

[Back to lab instructions]


Setup

  1. If the machine was on when you started using it, reboot it to MacOS.
  2. Follow these procedures to mount your blue home-directory on the local machine and create a PyCharm project (call it Lab06). You will use PyCharm in the next part, but, it is important that you set up your project now so that if you run into any issue, we can resolve them quickly.

Practice

1: Review

Answer Questions 1–7 in your Moodle writeup. You can use the the Online Python 3 tutor to help, but you should try to answer the questions on your own first.

2: Introduction to while loops

Enter the following Python code into the Online Python Tutor:

counter = 1
total = 0
while counter <= 5:
    total += counter
    counter += 1
print('Done')

Use the tutor to step through this loop, then answer Questions 8–10 in Moodle.