{ "cells": [ { "cell_type": "markdown", "id": "856519c5-b1f5-4bc8-8978-6e01287f6af0", "metadata": {}, "source": [ "## Warm Up - counting 9s\n", "\n", "Write a python function to do the following\n", "\n", "Given an array of ints, return the number of 9's in the array.\n", "```\n", "array_count9([1, 2, 9]) → 1\n", "array_count9([1, 9, 9]) → 2\n", "array_count9([1, 9, 9, 3, 9]) → 3\n", "```" ] }, { "cell_type": "code", "execution_count": 16, "id": "33517f67-5046-47a6-80cd-f3d5778817a2", "metadata": {}, "outputs": [], "source": [ "# Your code here\n" ] }, { "cell_type": "markdown", "id": "da14c5a6-4b75-4ab6-8e76-d01faf38ab5d", "metadata": {}, "source": [ "Write some tests for your functions. What are some edge cases you might consider?\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 18, "id": "bc86f35a-f72c-4e32-a09b-a040def02473", "metadata": {}, "outputs": [], "source": [ "# Your code here\n" ] }, { "cell_type": "markdown", "id": "14490e81-26eb-4c0e-91b0-1f34e4ccb8c9", "metadata": {}, "source": [ "Build up on this example, and write a function that takes a second optional argument that allows up to count any number passed in. It should default to 9.\n", "\n" ] }, { "cell_type": "code", "execution_count": 21, "id": "a48ab674-9995-4ebd-9846-e51591159c01", "metadata": {}, "outputs": [], "source": [ "# Your code here\n" ] }, { "cell_type": "markdown", "id": "b0f7318b-2242-4946-a12c-06f9fa2ad88c", "metadata": {}, "source": [ "Write some tests for your functions. What are some edge cases you might consider?\n" ] }, { "cell_type": "code", "execution_count": 22, "id": "9079f673-bf71-44bd-b526-7c464fdf3674", "metadata": {}, "outputs": [], "source": [ "# Your code here\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "666283cf-0a10-4fc5-94e7-9c4487914b59", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Anaconda3", "language": "python", "name": "anaconda3" }, "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.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }