{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Lab 03: Fizz Buzz Boom, Palindromes\n", "\n", "- **Name**: Domer McDomerson\n", "- **Netid**: dmcdomers" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Activity 1: Fizz, Buzz, Boom" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Function" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def fizz_buzz_boom(start, end):\n", " ''' For all the numbers between start and end (inclusive),\n", " \n", " - Display Fizz for multiples of 3\n", " - Display Buzz for multiples of 5 \n", " - Display Boom for multiples of 7\n", " - Display FizzBuzz for multiples of both 3 and 5\n", " - Display FizzBoom for multiples of both 3 and 7\n", " - Display BuzzBoom for multiples of both 5 and 7\n", " - Display FizzBuzzBoom for multiples of 3, 5, and 7\n", " - Display the number if it doesn't meet any of the criteria above.\n", " '''\n", " pass" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tests" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "A1_TESTS = [\n", " [3, 7],\n", " [1, 10],\n", " [10, 35],\n", " [100, 110],\n", "]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Write a loop that tests each of the sub-lists inside of the A1_TESTS list." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Reflection\n", "\n", "After you have completed the program above, answer the following questions:\n", "\n", "1. Describe the **flow control** of your program. What sort of **conditional** or **repeated execution** statements did you use?\n", "\n", " Add your response here.\n", "\n", "2. Why do you think this question often trips up candidates interviewing for programming positions? What was the **trickiest** part of this problem for you?\n", "\n", " Add your response here.\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Activity 2: Palindromes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Function" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def is_palindrome(numbers):\n", " ''' Return True if the numbers list is a palindromic sequence, otherwise return False ''' \n", " pass" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tests" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "A2_TESTS = [\n", " [1],\n", " [1, 2],\n", " [1, 2, 1],\n", " [1, 2, 2, 1],\n", " [1, 2, 3, 1],\n", " [1, 3, 2, 1],\n", " [1, 2, 3, 2, 1],\n", "]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Write a loop that tests each of the sub-lists inside of the A2_TESTS list." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Reflection\n", "\n", "After you have completed the program above, answer the following questions:\n", "\n", "1. Describe the **flow control** of your program. What sort of **conditional** or **repeated execution** statements did you use?\n", "\n", " \n", "\n", "2. Why do you think this question often trips up candidates interviewing for programming positions? What was the **trickiest** part of this problem for you?" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python3", "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.6.8" } }, "nbformat": 4, "nbformat_minor": 2 }