CSE 163, Spring 2019: Homework 1: Python Crash Course

Submission

This assignment and its reflection are due by Thursday, April 11 at 11:59 pm.

You should submit your finished hw1.py and hw1_test.py on Gradescope as well as submitting the HW reflection on Google Forms.

You may submit your assignment as many times as you want before the late cutoff (remember submitting after the due date will cost late days).

Overview

This homework is a Python problem set that asks you to implement many small functions to get CSE 142 students used to Python and to be a refresher for CSE 160 students.

After this homework, students will be able to:

  • Follow a Python development workflow for this course, including:
    • Writing a Python script from scratch and turning in the assignment.
    • Use the course infrastructure (flake8, test suites, course resources).
  • Use Python to review CS1 programming concepts implement programs that follow a specification, including:
    • Use/manipulation of various data types including numbers and strings.
    • Control structures (conditional statements, loops, parameters, returns) to implement basic functions provided by a specification.
    • Basic text file processing.
    • Documenting code.
  • Write unit tests to test each function written including their edge cases.

Expectations

Here are some baseline expectations we expect you to meet:

  • Follow the course collaboration policies

  • In hw1.py you should not use any import statements or features in Python we have not yet discussed in class, section, or HW specs. All of these problems should be solved using the basic constructs we've learned in class so far. However, for the test program you may import anything you want that is provided by the cse163 environment (using something outside will not work on turn-in)

Format

In this document, you will see blue boxes like the one below that provide extra information. It's a good idea to read all of these unless they are indicated as Optional

For example:

Try clicking on me

This will contain some useful information about the assignment

(Optional) Try clicking on me

This box might contain background information or further information that's not necessary for the assignment.

Table of Contents

This homework is technically split into three main parts, but the first is just making sure your development setup worked. You should do the remaining 2 parts concurrently since the last part is about testing your code. One school of thought for best developer practices is to write all your tests BEFORE you write any of your real code so you are certain it works as you are writing everything.

Evaluation

Your submission will be evaluated on the following dimensions

  • Your solution works externally for the cases shown
  • For this assignment, we will show you all tests that will be run against your submission on Gradescope to give you a better idea how to test your code. In future weeks, we will withhold some tests to evaluate your solution that you will not see when you submit your code. The withheld tests will be things described in the spec so they shouldn't be a surprise, but an important part of this class is learning how to test your own solution to be very sure it's correct.
  • All files submitted pass flake8, every function written is commented using a doc-string format, and all requirements for the problems are met.
  • Your hw1_test.py meets all the requirements listed in Part 2