{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "fb3af7ee",
   "metadata": {},
   "outputs": [],
   "source": [
    "myList1 = []                    # an empty list\n",
    "myList2 = [16, 8, 4, 2, 1]      # a typical list\n",
    "myList3 = [\"Boston\", 23.5, \"Pantera\", \"Los Lobos\"]\n",
    "myList4 = [1, 10, 100, 1000, 10000, 100000, 1000000]\n",
    "myList5 = [5, 6, myList4, 8, 10]\n",
    "myList6 = [\"item0\", \"item1\", \"item2\", \"item3\", \"item4\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "ffa22513",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[] \n",
      " [16, 8, 4, 2, 1] \n",
      " ['Boston', 23.5, 'Pantera', 'Los Lobos'] \n",
      " [1, 10, 100, 1000, 10000, 100000, 1000000] \n",
      " [5, 6, [1, 10, 100, 1000, 10000, 100000, 1000000], 8, 10] \n",
      " ['item0', 'item1', 'item2', 'item3', 'item4']\n"
     ]
    }
   ],
   "source": [
    "print(myList1, \"\\n\", myList2, \"\\n\", myList3, \"\\n\", myList4, \"\\n\", myList5, \"\\n\", myList6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "f5c3ac8d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'list'>\n"
     ]
    }
   ],
   "source": [
    "print(type(myList3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "43063b59",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "16 \n",
      " [10000] \n",
      " [1000, 10000, 100000, 1000000]\n",
      "['item2', 'item3', 'item4']\n"
     ]
    }
   ],
   "source": [
    "print(myList2[0], \"\\n\", myList4[4:5], \"\\n\", myList4[3:])\n",
    "print(myList6[-3:])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "3802164a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Length of myList1 =  0\n",
      "Length of myList3 =  4\n",
      "Length of myList6 =  5\n"
     ]
    }
   ],
   "source": [
    "print(\"Length of myList1 = \", len(myList1))\n",
    "print(\"Length of myList3 = \", len(myList3))\n",
    "print(\"Length of myList6 = \", len(myList6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3faf4519",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 \n",
      " 1000 \n",
      " item4\n"
     ]
    }
   ],
   "source": [
    "print(myList4[0], \"\\n\", myList4[3], \"\\n\", myList6[4])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "269992d9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5   :   [16, 8, 4, 2, 1]\n",
      "6   :   [16, 8, 4, 2, 1, 0]\n"
     ]
    }
   ],
   "source": [
    "print(len(myList2), \"  :  \", myList2)\n",
    "myList2.append(0)\n",
    "print(len(myList2), \"  :  \", myList2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "25ea7ee9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4   :   ['Boston', 23.5, 'Pantera', 'Los Lobos']\n",
      "5   :   ['Boston', 23.5, 'Jeff Beck', 'Pantera', 'Los Lobos']\n"
     ]
    }
   ],
   "source": [
    "print(len(myList3), \"  :  \", myList3)\n",
    "myList3.insert(2, \"Jeff Beck\")\n",
    "print(len(myList3), \"  :  \", myList3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "144b2484",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Other list operations include: extend(), remove(), pop(), & del()\n"
     ]
    }
   ],
   "source": [
    "print(\"Other list operations include: extend(), remove(), pop(), & del()\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "292d5cf1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[16, 8, 4, 2, 1, 0] myList2 as is\n",
      "[0, 1, 2, 4, 8, 16] myList2 sorted (normal order)\n",
      "[16, 8, 4, 2, 1, 0] myList2 sorted (reverse order)\n"
     ]
    }
   ],
   "source": [
    "print(myList2, \"myList2 as is\")\n",
    "myList2.sort()\n",
    "print(myList2, \"myList2 sorted (normal order)\")\n",
    "myList2.sort(reverse = True)\n",
    "print(myList2, \"myList2 sorted (reverse order)\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "5f4b1915",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[5, 6, [1, 10, 100, 1000, 10000, 100000, 1000000], 8, 10]\n",
      "100000\n"
     ]
    }
   ],
   "source": [
    "print(myList5)\n",
    "print(myList5[2][5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4ebaf20b",
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "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.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
