{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2496435"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Dictionaries\n",
    "county_census_pop_2010 = {\"Brevard\":543376, \"Broward\":1748066, \"Collier\":321520, \n",
    "                   \"Hillsborough\":1229226, \"Miami-Dade\":2496435, \"Monroe\":73090, \n",
    "                   \"Palm Beach\":1320134, \"Pinellas\":916542}\n",
    "county_census_pop_2010['Miami-Dade']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1748066"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "county_census_pop_2010['Broward']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'Polk'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-5-731a13b135f4>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mcounty_census_pop_2010\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'Polk'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mKeyError\u001b[0m: 'Polk'"
     ]
    }
   ],
   "source": [
    "county_census_pop_2010['Polk']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "602095"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "county_census_pop_2010['Polk'] = 602095\n",
    "county_census_pop_2010['Duval'] = 864263\n",
    "county_census_pop_2010['Polk']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Brevard': 543376,\n",
       " 'Broward': 1748066,\n",
       " 'Collier': 321520,\n",
       " 'Hillsborough': 1229226,\n",
       " 'Miami-Dade': 2496435,\n",
       " 'Monroe': 73090,\n",
       " 'Palm Beach': 1320134,\n",
       " 'Pinellas': 916542,\n",
       " 'Polk': 602095,\n",
       " 'Duval': 864263}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "county_census_pop_2010"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "county_area = {} # an empty dictionary\n",
    "county_area"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(county_census_pop_2010)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'Polk' in county_census_pop_2010"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "morse = {\n",
    "\"A\" : \".-\", \n",
    "\"B\" : \"-...\", \n",
    "\"C\" : \"-.-.\", \n",
    "\"D\" : \"-..\", \n",
    "\"E\" : \".\", \n",
    "\"F\" : \"..-.\", \n",
    "\"G\" : \"--.\", \n",
    "\"H\" : \"....\", \n",
    "\"I\" : \"..\", \n",
    "\"J\" : \".---\", \n",
    "\"K\" : \"-.-\", \n",
    "\"L\" : \".-..\", \n",
    "\"M\" : \"--\", \n",
    "\"N\" : \"-.\", \n",
    "\"O\" : \"---\", \n",
    "\"P\" : \".--.\", \n",
    "\"Q\" : \"--.-\", \n",
    "\"R\" : \".-.\", \n",
    "\"S\" : \"...\", \n",
    "\"T\" : \"-\", \n",
    "\"U\" : \"..-\", \n",
    "\"V\" : \"...-\", \n",
    "\"W\" : \".--\", \n",
    "\"X\" : \"-..-\", \n",
    "\"Y\" : \"-.--\", \n",
    "\"Z\" : \"--..\", \n",
    "\"0\" : \"-----\", \n",
    "\"1\" : \".----\", \n",
    "\"2\" : \"..---\", \n",
    "\"3\" : \"...--\", \n",
    "\"4\" : \"....-\", \n",
    "\"5\" : \".....\", \n",
    "\"6\" : \"-....\", \n",
    "\"7\" : \"--...\", \n",
    "\"8\" : \"---..\", \n",
    "\"9\" : \"----.\", \n",
    "\".\" : \".-.-.-\", \n",
    "\",\" : \"--..--\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "38"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(morse)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Brevard\n",
      "Broward\n",
      "Collier\n",
      "Hillsborough\n",
      "Miami-Dade\n",
      "Monroe\n",
      "Palm Beach\n",
      "Pinellas\n",
      "Polk\n",
      "Duval\n"
     ]
    }
   ],
   "source": [
    "for key in county_census_pop_2010.keys(): \n",
    "    print(key)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "543376\n",
      "1748066\n",
      "321520\n",
      "1229226\n",
      "2496435\n",
      "73090\n",
      "1320134\n",
      "916542\n",
      "602095\n",
      "864263\n"
     ]
    }
   ],
   "source": [
    "for value in county_census_pop_2010.values():\n",
    "    print(value)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Brevard\t543376\n",
      "Broward\t1748066\n",
      "Collier\t321520\n",
      "Hillsborough\t1229226\n",
      "Miami-Dade\t2496435\n",
      "Monroe\t73090\n",
      "Palm Beach\t1320134\n",
      "Pinellas\t916542\n",
      "Polk\t602095\n",
      "Duval\t864263\n"
     ]
    }
   ],
   "source": [
    "for key in county_census_pop_2010.keys(): \n",
    "    print(key + \"\\t\" + str(county_census_pop_2010[key]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Brevard\t543376\n",
      "Broward\t1748066\n",
      "Collier\t321520\n",
      "Hillsborough\t1229226\n",
      "Miami-Dade\t2496435\n",
      "Monroe\t73090\n",
      "Palm Beach\t1320134\n",
      "Pinellas\t916542\n",
      "Polk\t602095\n",
      "Duval\t864263\n"
     ]
    }
   ],
   "source": [
    "for key, value in county_census_pop_2010.items(): \n",
    "    print(key + \"\\t\" + str(value))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "What is the population of Pinellas county? 1748066.\n",
      "What is the population of Miami-Dade county? 73090.\n",
      "What is the population of Monroe county? 1320134.\n",
      "What is the population of Palm Beach county? 1229226.\n",
      "What is the population of Broward county? 543376.\n",
      "What is the population of Brevard county? 321520.\n",
      "What is the population of Collier county? 2496435.\n",
      "What is the population of Hillsborough county? 916542.\n"
     ]
    }
   ],
   "source": [
    "counties = {\"Brevard\", \"Broward\", \"Collier\", \n",
    "                   \"Hillsborough\", \"Miami-Dade\", \"Monroe\", \n",
    "                   \"Palm Beach\", \"Pinellas\"}\n",
    "pop = {543376, 1748066, 321520, \n",
    "                   1229226, 2496435, 73090, \n",
    "                   1320134, 916542}\n",
    "for c, p in zip(counties, pop):\n",
    "    print('What is the population of {0} county? {1}.'.format(c, p))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
