From b933074c9d99090515fdf5a2f605b6f46c9b8277 Mon Sep 17 00:00:00 2001 From: Andy Kuemmel <kuemmel@wisc.edu> Date: Thu, 22 Sep 2022 14:23:16 -0500 Subject: [PATCH] Update f22/andy_lec_notes/lec08_Sep23_Conditionals1/lec_08_conditionals1_template.ipynb --- .../lec_08_conditionals1_template.ipynb | 67 ++++++------------- 1 file changed, 19 insertions(+), 48 deletions(-) diff --git a/f22/andy_lec_notes/lec08_Sep23_Conditionals1/lec_08_conditionals1_template.ipynb b/f22/andy_lec_notes/lec08_Sep23_Conditionals1/lec_08_conditionals1_template.ipynb index 54d3ceb..6d8d2ad 100644 --- a/f22/andy_lec_notes/lec08_Sep23_Conditionals1/lec_08_conditionals1_template.ipynb +++ b/f22/andy_lec_notes/lec08_Sep23_Conditionals1/lec_08_conditionals1_template.ipynb @@ -1,19 +1,10 @@ { "cells": [ { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "# Warmup: " - ] - }, - { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ - "# February 11: Conditionals part 1\n", + "# Lecture 8 Conditionals part 1\n", "Learing Objectives:\n", "\n", "Write Conditional Statements\n", @@ -124,18 +115,9 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "metadata": {}, - "outputs": [ - { - "ename": "IndentationError", - "evalue": "expected an indented block (<ipython-input-3-f40f344477b1>, line 8)", - "output_type": "error", - "traceback": [ - "\u001b[0;36m File \u001b[0;32m\"<ipython-input-3-f40f344477b1>\"\u001b[0;36m, line \u001b[0;32m8\u001b[0m\n\u001b[0;31m def categorize_age(age):\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m expected an indented block\n" - ] - } - ], + "outputs": [], "source": [ "# Example 2: Let's classify young people by age\n", "# what classifications would you use?\n", @@ -189,28 +171,13 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "# See the slides" + "Check out slides 19-25\n", + "https://www.msyamkumar.com/cs220/s22/materials/lecture_ppts/lec_08_S22.pdf" ] }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null, @@ -271,8 +238,10 @@ "source": [ "# second function: convert a day (int) into a string writing '15th', '23rd' or \"N/A\"\n", "def day_to_str(day):\n", - " \"\"\"Covert a day into a date string with proper ending. \n", - " 16 --> '16th', 23 --> '23rd', \"\"\"\n", + " \"\"\"\n", + " Covert a day into a date string with proper ending. \n", + " 16 --> '16th' 23 --> '23rd'\n", + " \"\"\"\n", " pass\n", "\n", "print(day_to_str(4))\n", @@ -293,8 +262,11 @@ "# 1996 ---> 1996 # if year before 2000 return all 4 digits, as a string\n", "\n", "def year_to_str(year):\n", - " \"\"\"Convert a year (as an integer) into a string. If the year is < 2000, return the full 4 digits\n", - " Otherwise, return the last 2 digits with a single quote in front\"\"\"\n", + " \"\"\"\n", + " Convert a year (as an integer) into a string. \n", + " If the year is before 2000, return the full 4 digits.\n", + " Otherwise, return the last 2 digits with a single quote in front.\n", + " \"\"\"\n", " pass\n" ] }, @@ -325,15 +297,14 @@ "outputs": [], "source": [ "# Do this after lecture:\n", - "# Worksheet (good exam practice)\n", - "# Interactive Exercises (has worksheet answers)\n", + "# Interactive Exercises \n", "# Python for Everybody (helps you gain coding fluency...projects take less time)" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -347,7 +318,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.9.12" } }, "nbformat": 4, -- GitLab