{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Introduction and Running Python\n",
    "#### CS 66: Introduction to Computer Science II"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Course website and Syllabus\n",
    "\n",
    "Hopefully you've had a chance to look through the course web site and followed instructions from last time\n",
    "* read syllabus\n",
    "* install some tools\n",
    "\n",
    "Let's go check it out and discuss in a little more detail"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Installing Python and Visual Studio Code\n",
    "\n",
    "* How did this go?\n",
    "* Let's stop and get everyone up and running"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## In-Class Activities\n",
    "\n",
    "Make a group of 3-4 students. \n",
    "\n",
    "Have a discussion about each of these problems."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Group Activity Problem 1\n",
    "\n",
    "Run the following code examples. In the note section below, describe what this code does."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "my_list = [35,66,70,5,42,10,12]\n",
    "print(42 in my_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "my_list = [35,66,70,5,42,10,12]\n",
    "print(0 in my_list)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Group Activity Problem 2\n",
    "\n",
    "If you run this code by itself, it doesn't do anything. How can you get it to work like it is meant to?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def search_for(item, list_to_search_in):\n",
    "    \n",
    "    result = item in list_to_search_in\n",
    "\n",
    "    return result"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Group Activity Problem 3\n",
    "\n",
    "Rewrite the `search_for` function above so that it uses a loop and if statement rather than the list-contains operator (i.e., `in`).  Note that you can still use the `in` operator if setting up a for loop, just don't directly use it to check if the item is in the list."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def search_for(item, list_to_search_in):\n",
    "    \n",
    "    return False #you'll need to change this line after you get your loop and if statement working"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Slideshow",
  "jekyll": {
   "layout": "single",
   "permalink": "/notes/",
   "title": "Introduction"
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.10.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
