CSE 163, Winter 2020: Homework 1: Python Crash Course

Submission

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

You should submit your finished hw1.py and hw1_test.py on Ed 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). Recall on Ed, you submit by pressing the "Mark" button. You are welcome to develop the assignment on Ed or develop locally and then upload to Ed before marking.

Overview and Learning Objectives

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 Ed 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.
  • Your code meets our style requirements:
    • All files submitted pass flake8.
    • Your program should be written with good programming style. This means you should use the proper naming convention for methods (snake_case), your code should not be overly redundant and should avoid unnecessary computations.
    • Every function written is commented using a doc-string format that describes its behavior, parameters, returns, and highlights any special cases. These comments must be in your own words.
    • There is a comment at the top of each file you write with your name, section, and a brief description of what that program does.
    • Any expectations on this page or the sub-pages for the assignment are met as well as all requirements for each of the problems are met.