{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Denison CS181/DA210 Homework\n", "\n", "Before you turn this problem in, make sure everything runs as expected. This is a combination of **restarting the kernel** and then **running all cells** (in the menubar, select Kernel$\\rightarrow$Restart And Run All).\n", "\n", "Make sure you fill in any place that says YOUR CODE HERE or \"YOUR ANSWER HERE\"." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Short Answer Questions\n", "\n", "This notebook shows how things look for questions that expect the student to fill in a **markdown** cell with a fill-in descriptive answer. Feel free to use Markdown facilities to help format your answer, like using italics and boldface, or to use bullet lists or numbered lists, if appropriate. Under the Help menu, you can find a help page that gives basic Markdown help." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Consider the following piece of code:\n", "\n", "python\n", "def f(x):\n", " if x == 0 or x == 1:\n", " return x\n", " return f(x - 1) + f(x - 2)\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "## Part A (1 point)\n", "\n", "Describe, in words, what this code does, and how it does it." ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "nbgrader": { "cell_type": "markdown", "checksum": "eeca9d9984864d10dd3a1a6c2bd2977f", "grade": true, "grade_id": "cell-6d6644b48136e2b1", "locked": false, "points": 1, "schema_version": 3, "solution": true, "task": false } }, "source": [ "YOUR ANSWER HERE" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "## Part B (1 points)\n", "\n", "For what inputs will this function not behave as expected? What will happen?" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "nbgrader": { "cell_type": "markdown", "checksum": "c62ac857f2e809cce174dcdaa883437a", "grade": true, "grade_id": "cell-99e5d02f5c9b41f0", "locked": false, "points": 1, "schema_version": 3, "solution": true, "task": false } }, "source": [ "YOUR ANSWER HERE" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.3" } }, "nbformat": 4, "nbformat_minor": 4 }