{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ch02-title",
   "metadata": {},
   "source": [
    "# Syntax and Types"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch02-overview",
   "metadata": {},
   "source": [
    "This chapter builds the basic vocabulary of Python programs: names, values, operators, and types.\n",
    "\n",
    "- Variables and assignment\n",
    "- Operators and expressions\n",
    "- Basic scalar types\n",
    "- Collection type overview\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0200-video",
   "metadata": {},
   "source": [
    "<h2>Chapter Video</h2>\n",
    "\n",
    "This overview introduces numeric data, arithmetic operators, comparisons, and basic type conversion.\n",
    "\n",
    "```{raw} html\n",
    "<iframe width=\"100%\" height=\"400\" src=\"https://www.youtube-nocookie.com/embed/khKv-8q7YmY\" title=\"Python Tutorial for Beginners 3: Integers and Floats - Working with Numeric Data\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen referrerpolicy=\"strict-origin-when-cross-origin\"></iframe>\n",
    "```\n",
    "\n",
    "> *[Python Tutorial for Beginners 3: Integers and Floats - Working with Numeric Data (11:55)](https://youtube.com/watch?v=khKv-8q7YmY) by Corey Schafer*\n",
    ">\n",
    "> Hosted on YouTube; property of its original creator, embedded here for educational reference only."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch02-goals",
   "metadata": {},
   "source": [
    "<h2>Learning Objectives</h2>\n",
    "\n",
    "By the end of this chapter, you will be able to:\n",
    "\n",
    "1. Create and name variables using Python assignment syntax\n",
    "2. Use arithmetic, comparison, logical, and assignment operators\n",
    "3. Classify values by built-in type\n",
    "4. Convert values between compatible built-in types\n",
    "5. Choose appropriate basic and collection types for simple data\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch02-flow",
   "metadata": {},
   "source": [
    "<h2>Chapter Flow</h2>\n",
    "\n",
    "```{container} chapter-flow\n",
    "1. {doc}`0201-variables-and-objects`\n",
    "2. {doc}`0202-operators`\n",
    "3. {doc}`0203-builtin-types`\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch02-glossary",
   "metadata": {},
   "source": [
    "<h2>Glossary</h2>\n",
    "\n",
    "| # | Term | Explanation |\n",
    "|---:|---|---|\n",
    "| 1 | Variable | A name that refers to a value or object in a program. |\n",
    "| 2 | Assignment statement | A statement that binds a variable name to a value, such as `score = 95`. |\n",
    "| 3 | Naming Rules & Conventions | Shared rules and recommended styles for variable names and other identifiers. |\n",
    "| 4 | Object | A Python value with an identity, a type, and data. |\n",
    "| 5 | Identity | The unique object reference Python uses to tell whether two names point to the same object. |\n",
    "| 6 | Alias | A second name that refers to the same object as another name. |\n",
    "| 7 | Type | The category of a value, such as `int`, `float`, `str`, `bool`, `list`, or `dict`. |\n",
    "| 8 | Operator | A symbol or word that performs an operation, such as `+`, `==`, `and`, `or`, or `in`. |\n",
    "| 9 | Operand | A value that an operator works on. |\n",
    "| 10 | Expression | A piece of code that evaluates to a value. |\n",
    "| 11 | Type conversion | The process of changing a value from one type to another. |\n",
    "| 12 | Type hint | An annotation that records the expected type of a variable, parameter, or return value. |\n",
    "| 13 | Mutable | Describes an object whose contents can be changed after creation. |\n",
    "| 14 | Immutable | Describes an object whose contents cannot be changed after creation. |\n",
    "| 15 | List | An ordered, mutable collection of values. |\n",
    "| 16 | Tuple | An ordered, immutable collection of values. |\n",
    "| 17 | Dictionary | A mutable collection that stores key-value pairs. |\n",
    "| 18 | Set | A mutable collection that stores unique values without a fixed order. |\n",
    "| 19 | Boolean | A type with two possible values: `True` and `False`. |\n",
    "| 20 | Truthy | Describes a value that behaves like `True` in a Boolean context. |\n",
    "| 21 | Falsy | Describes a value that behaves like `False` in a Boolean context. |\n",
    "| 22 | Reassignment | Binding an existing variable name to a different object; the old object itself is not changed. |\n",
    "| 23 | Mutation | Changing the contents of an object in place, such as appending to a list, so every name that refers to it sees the change. |\n",
    "| 24 | Dynamic typing | Python's approach of determining a variable's type at run time from the value assigned, so you do not declare types. |\n",
    "| 25 | Floor division | The `//` operator, which divides two numbers and rounds the result down to the nearest integer. |\n",
    "| 26 | Modulus operator | The `%` operator, which returns the remainder after division. |\n",
    "| 27 | Membership operator | The `in` or `not in` operator, which checks whether a value is present in a collection. |\n",
    "| 28 | Short-circuit evaluation | Evaluation of `and` and `or` that stops as soon as the result is known, so the second operand may never be evaluated. |\n",
    "| 29 | Operator precedence | The rules that decide which operations in an expression are evaluated first, such as `**` before `+`. |\n",
    "| 30 | Type casting | Explicit conversion that you perform by calling a type constructor, such as `int(\"42\")`. |\n",
    "| 31 | Type coercion | Implicit conversion that Python performs automatically, such as treating `3` as `3.0` in `3 + 4.5`. |\n",
    "| 32 | String | An immutable sequence of characters written in quotes, such as `\"apple\"`. |\n",
    "| 33 | Concatenation | Joining strings end to end with the `+` operator. |\n",
    "| 34 | Escape sequence | A backslash followed by a character, such as `\\n` or `\\'`, that represents a special character inside a string. |\n",
    "| 35 | Indexing | Accessing one item of a sequence by its position in square brackets, starting from 0, such as `s[0]`. |\n",
    "| 36 | Slicing | Extracting part of a sequence with `[start:stop:step]`, where the item at the stop index is not included. |\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0200-slides",
   "metadata": {},
   "source": [
    "<h2><a href=\"overview.html\" target=\"_blank\" style=\"color: var(--pst-color-link, #176de8);\">Chapter Overview Slides</a></h2>"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
