Lab 1: Notes

Course Administration

You can submit your assignments as often as you like before the deadline; only the last submission will be graded. If you need an extension due to compelling circumstances, you need to let me know ahead of time (via e-mail before the deadline). That way I know to expect a late submission and can get your submission promptly into the grading queue.

Coding Best Practices

  1. When a function includes a return statement, you can think of that function like a mathematical function. E.g., the function f(x) = 2*x would be defined in Python as:
     def f(x):
         return 2*x
    

    The expression f(7) has the value 14.

    When a function includes print statements, that function is being used as a simple output feature of a program, outputting text to the shell window. We usually don’t include print statements in functions that return a value.

  2. Review the expectations about good coding practice written up in the notes for lecture 2, including the different kinds and purposes of comments.

  3. Take the time to make your code look beautiful! Use consistent spacing and blank lines between functions to greatly improve readability.