master ed69ec6b229d cached
373 files
39.0 MB
1.1M tokens
11 symbols
1 requests
Download .txt
Showing preview only (4,387K chars total). Download the full file or copy to clipboard to get everything.
Repository: Pierian-Data/Complete-Python-3-Bootcamp
Branch: master
Commit: ed69ec6b229d
Files: 373
Total size: 39.0 MB

Directory structure:
gitextract_qnczp_qk/

├── .ipynb_checkpoints/
│   └── Untitled-checkpoint.ipynb
├── 00-Python Object and Data Structure Basics/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Numbers-checkpoint.ipynb
│   │   ├── 01-Variable Assignment-checkpoint.ipynb
│   │   ├── 02-Strings-checkpoint.ipynb
│   │   ├── 03-Print Formatting with Strings-checkpoint.ipynb
│   │   ├── 04-Lists-checkpoint.ipynb
│   │   ├── 05-Dictionaries-checkpoint.ipynb
│   │   ├── 06-Tuples-checkpoint.ipynb
│   │   ├── 07-Sets and Booleans-checkpoint.ipynb
│   │   ├── 08-Files-checkpoint.ipynb
│   │   ├── 09-Objects and Data Structures Assessment Test-checkpoint.ipynb
│   │   └── 10-Objects and Data Structures Assessment Test-Solution-checkpoint.ipynb
│   ├── 01-Numbers.ipynb
│   ├── 01-Variable Assignment.ipynb
│   ├── 02-Strings.ipynb
│   ├── 03-Print Formatting with Strings.ipynb
│   ├── 04-Lists.ipynb
│   ├── 05-Dictionaries.ipynb
│   ├── 06-Tuples.ipynb
│   ├── 07-Sets and Booleans.ipynb
│   ├── 08-Files.ipynb
│   ├── 09-Objects and Data Structures Assessment Test.ipynb
│   ├── 10-Objects and Data Structures Assessment Test-Solution.ipynb
│   └── test.txt
├── 01-Python Comparison Operators/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Comparison Operators-checkpoint.ipynb
│   │   └── 02-Chained Comparison Operators-checkpoint.ipynb
│   ├── 01-Comparison Operators.ipynb
│   └── 02-Chained Comparison Operators.ipynb
├── 02-Python Statements/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Introduction to Python Statements-checkpoint.ipynb
│   │   ├── 02-if, elif, and else Statements-checkpoint.ipynb
│   │   ├── 03-for Loops-checkpoint.ipynb
│   │   ├── 04-while Loops-checkpoint.ipynb
│   │   ├── 05-Useful-Operators-checkpoint.ipynb
│   │   ├── 05-range()-checkpoint.ipynb
│   │   ├── 06-List Comprehensions-checkpoint.ipynb
│   │   ├── 07-Statements Assessment Test-checkpoint.ipynb
│   │   ├── 08-Statements Assessment Test - Solutions-checkpoint.ipynb
│   │   ├── 09-Guessing Game Challenge-checkpoint.ipynb
│   │   └── 10-Guessing Game Challenge - Solution-checkpoint.ipynb
│   ├── 01-Introduction to Python Statements.ipynb
│   ├── 02-if, elif, and else Statements.ipynb
│   ├── 03-for Loops.ipynb
│   ├── 04-while Loops.ipynb
│   ├── 05-Useful-Operators.ipynb
│   ├── 06-List Comprehensions.ipynb
│   ├── 07-Statements Assessment Test.ipynb
│   ├── 08-Statements Assessment Test - Solutions.ipynb
│   ├── 09-Guessing Game Challenge.ipynb
│   └── 10-Guessing Game Challenge - Solution.ipynb
├── 03-Methods and Functions/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Methods-checkpoint.ipynb
│   │   ├── 02-Functions-checkpoint.ipynb
│   │   ├── 03-Function Practice Exercises-checkpoint.ipynb
│   │   ├── 03-Lambda expressions-checkpoint.ipynb
│   │   ├── 04-Function Practice Exercises - Solutions-checkpoint.ipynb
│   │   ├── 04-Nested Statements and Scope-checkpoint.ipynb
│   │   ├── 05-Functions and Methods Homework-checkpoint.ipynb
│   │   ├── 05-Lambda-Expressions-Map-and-Filter-checkpoint.ipynb
│   │   ├── 06-Functions and Methods Homework - Solutions-checkpoint.ipynb
│   │   ├── 06-Nested Statements and Scope-checkpoint.ipynb
│   │   ├── 07-args and kwargs-checkpoint.ipynb
│   │   ├── 08-Function Practice Exercises-checkpoint.ipynb
│   │   ├── 08-Functions and Methods Homework-checkpoint.ipynb
│   │   ├── 09-Function Practice Exercises - Solutions-checkpoint.ipynb
│   │   └── 09-Functions and Methods Homework - Solutions-checkpoint.ipynb
│   ├── 01-Methods.ipynb
│   ├── 02-Functions.ipynb
│   ├── 03-Function Practice Exercises.ipynb
│   ├── 04-Function Practice Exercises - Solutions.ipynb
│   ├── 05-Lambda-Expressions-Map-and-Filter.ipynb
│   ├── 06-Nested Statements and Scope.ipynb
│   ├── 07-args and kwargs.ipynb
│   ├── 08-Functions and Methods Homework.ipynb
│   └── 09-Functions and Methods Homework - Solutions.ipynb
├── 04-Milestone Project - 1/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Warm-Up-Project-Exercises-checkpoint.ipynb
│   │   ├── 01-Milestone Project 1 - Assignment-checkpoint.ipynb
│   │   ├── 02-Milestone Project 1 - Walkthrough Steps Workbook-checkpoint.ipynb
│   │   └── 03-Milestone Project 1 - Complete Walkthrough Solution-checkpoint.ipynb
│   ├── 00-Warm-Up-Project-Exercises.ipynb
│   ├── 01-Milestone Project 1 - Assignment.ipynb
│   ├── 02-Milestone Project 1 - Walkthrough Steps Workbook.ipynb
│   └── 03-Milestone Project 1 - Complete Walkthrough Solution.ipynb
├── 05-Object Oriented Programming/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Object Oriented Programming-Copy1-checkpoint.ipynb
│   │   ├── 01-Object Oriented Programming-checkpoint.ipynb
│   │   ├── 02-Object Oriented Programming Homework-checkpoint.ipynb
│   │   ├── 03-Object Oriented Programming Homework - Solution-checkpoint.ipynb
│   │   ├── 04-OOP Challenge-checkpoint.ipynb
│   │   └── 05-OOP Challenge - Solution-checkpoint.ipynb
│   ├── 01-Object Oriented Programming.ipynb
│   ├── 02-Object Oriented Programming Homework.ipynb
│   ├── 03-Object Oriented Programming Homework - Solution.ipynb
│   ├── 04-OOP Challenge.ipynb
│   └── 05-OOP Challenge - Solution.ipynb
├── 06-Modules and Packages/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Modules and Packages-checkpoint.ipynb
│   │   └── Useful_Info_Notebook-checkpoint.ipynb
│   ├── 00-Modules_and_Packages/
│   │   ├── MyMainPackage/
│   │   │   ├── SubPackage/
│   │   │   │   ├── __init__.py
│   │   │   │   └── mysubscript.py
│   │   │   ├── __init__.py
│   │   │   └── some_main_script.py
│   │   ├── mymodule.py
│   │   └── myprogram.py
│   ├── 01-Name_and_Main/
│   │   ├── Explanation.txt
│   │   ├── one.py
│   │   └── two.py
│   └── Useful_Info_Notebook.ipynb
├── 07-Errors and Exception Handling/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Errors and Exceptions Handling-checkpoint.ipynb
│   │   ├── 02-Errors and Exceptions Homework-checkpoint.ipynb
│   │   ├── 03-Errors and Exceptions Homework - Solution-checkpoint.ipynb
│   │   └── 04-Unit Testing-checkpoint.ipynb
│   ├── 01-Errors and Exceptions Handling.ipynb
│   ├── 02-Errors and Exceptions Homework.ipynb
│   ├── 03-Errors and Exceptions Homework - Solution.ipynb
│   ├── 04-Unit Testing.ipynb
│   ├── cap.py
│   ├── simple1.py
│   ├── simple2.py
│   ├── test_cap.py
│   └── testfile
├── 08-Milestone Project - 2/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Milestone-2-Warmup-Project-checkpoint.ipynb
│   │   ├── 01-Milestone Project 2 - Assignment-checkpoint.ipynb
│   │   ├── 02-Milestone Project 2 - Walkthrough Steps Workbook-checkpoint.ipynb
│   │   └── 03-Milestone Project 2 - Complete Walkthrough Solution-checkpoint.ipynb
│   ├── 00-Milestone-2-Warmup-Project.ipynb
│   ├── 01-Milestone Project 2 - Assignment.ipynb
│   ├── 02-Milestone Project 2 - Walkthrough Steps Workbook.ipynb
│   └── 03-Milestone Project 2 - Complete Walkthrough Solution.ipynb
├── 09-Empty-Section-Skip/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Map-checkpoint.ipynb
│   │   ├── 02-Reduce-checkpoint.ipynb
│   │   ├── 03-Filter-checkpoint.ipynb
│   │   ├── 04-Zip-checkpoint.ipynb
│   │   ├── 05-Enumerate-checkpoint.ipynb
│   │   ├── 06-all() and any()-checkpoint.ipynb
│   │   ├── 07-Complex-checkpoint.ipynb
│   │   ├── 08-Built-in Functions Assessment Test-checkpoint.ipynb
│   │   └── 09-Built-in Functions Assessment Test - Solution-checkpoint.ipynb
│   ├── 01-Map.ipynb
│   ├── 02-Reduce.ipynb
│   ├── 03-Filter.ipynb
│   ├── 04-Zip.ipynb
│   ├── 05-Enumerate.ipynb
│   ├── 06-all() and any().ipynb
│   ├── 07-Complex.ipynb
│   ├── 08-Built-in Functions Assessment Test.ipynb
│   └── 09-Built-in Functions Assessment Test - Solution.ipynb
├── 10-Python Decorators/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Decorators-checkpoint.ipynb
│   │   └── 02-Decorators Homework-checkpoint.ipynb
│   ├── 01-Decorators.ipynb
│   └── 02-Decorators Homework.ipynb
├── 11-Python Generators/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Iterators and Generators-checkpoint.ipynb
│   │   ├── 02-Iterators and Generators Homework-checkpoint.ipynb
│   │   └── 03-Iterators and Generators Homework - Solution-checkpoint.ipynb
│   ├── 01-Iterators and Generators.ipynb
│   ├── 02-Iterators and Generators Homework.ipynb
│   └── 03-Iterators and Generators Homework - Solution.ipynb
├── 12-Advanced Python Modules/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Collections-Module-checkpoint.ipynb
│   │   ├── 01-Datetime-Module-checkpoint.ipynb
│   │   ├── 01-Opening-and-Reading-Files-Folders-checkpoint.ipynb
│   │   ├── 02-Datetime-Module-checkpoint.ipynb
│   │   ├── 02-Math-and-Random-Module-checkpoint.ipynb
│   │   ├── 03-Math-and-Random-Module-checkpoint.ipynb
│   │   ├── 03-Python Debugger (pdb)-checkpoint.ipynb
│   │   ├── 04-Python Debugger (pdb)-checkpoint.ipynb
│   │   ├── 04-Timing your code - timeit-checkpoint.ipynb
│   │   ├── 05-Overview-of-Regular-Expressions-checkpoint.ipynb
│   │   ├── 06-Timing your code - timeit-checkpoint.ipynb
│   │   ├── 06-Unzipping-and-Zipping-Files-checkpoint.ipynb
│   │   ├── 07-OS-Module-checkpoint.ipynb
│   │   ├── 07-Unzipping-and-Zipping-Files-checkpoint.ipynb
│   │   └── 09-Advanced-Modules-Exercise-Solutions-checkpoint.ipynb
│   ├── 00-Collections-Module.ipynb
│   ├── 01-Opening-and-Reading-Files-Folders.ipynb
│   ├── 02-Datetime-Module.ipynb
│   ├── 03-Math-and-Random-Module.ipynb
│   ├── 04-Python Debugger (pdb).ipynb
│   ├── 05-Overview-of-Regular-Expressions.ipynb
│   ├── 06-Timing your code - timeit.ipynb
│   ├── 07-Unzipping-and-Zipping-Files.ipynb
│   ├── 08-Advanced-Python-Module-Exercise/
│   │   ├── .ipynb_checkpoints/
│   │   │   ├── 07-Advanced-Modules-Exercise-Puzzle-checkpoint.ipynb
│   │   │   └── 08-Advanced-Modules-Exercise-Solutions-checkpoint.ipynb
│   │   ├── 07-Advanced-Modules-Exercise-Puzzle.ipynb
│   │   ├── 08-Advanced-Modules-Exercise-Solutions.ipynb
│   │   └── extracted_content/
│   │       ├── Five/
│   │       │   ├── AEITMYIRQLP.txt
│   │       │   ├── APJKSRITGGX.txt
│   │       │   ├── AQKATDFGXTS.txt
│   │       │   ├── ARLKFCWIAJE.txt
│   │       │   ├── AXJGVPVEFAS.txt
│   │       │   ├── BNUQEHCFRTG.txt
│   │       │   ├── BSKJDRNEZQM.txt
│   │       │   ├── BTYWAHLHKBM.txt
│   │       │   ├── BUGKBZWRRVI.txt
│   │       │   ├── BVBURZZCAPR.txt
│   │       │   ├── CAHBEVSVDDN.txt
│   │       │   ├── COMGMZBJAYE.txt
│   │       │   ├── CRFSDGYFSHA.txt
│   │       │   ├── CSCLFZCDYYC.txt
│   │       │   ├── CXBVCTRBBIE.txt
│   │       │   ├── DDLASODUVPX.txt
│   │       │   ├── DHZBAAYEADM.txt
│   │       │   ├── DQPZQLBCJYP.txt
│   │       │   ├── DYOPIIVMZOO.txt
│   │       │   ├── DZUWWXYIAEL.txt
│   │       │   ├── EAAOEPSAWMQ.txt
│   │       │   ├── EIPWXMQZJKU.txt
│   │       │   ├── ESIZWBHMGDP.txt
│   │       │   ├── ETCUEXWNBCF.txt
│   │       │   └── EYTCGIOYWIW.txt
│   │       ├── Four/
│   │       │   ├── ECIOBYCDVFI.txt
│   │       │   ├── EMTGPSXQEJX.txt
│   │       │   ├── EPRNUHRSESC.txt
│   │       │   ├── ESDIZXHYCVY.txt
│   │       │   ├── EXVQSVBQQQH.txt
│   │       │   ├── QCTCKDIBBVG.txt
│   │       │   ├── QCWCFLKNZMN.txt
│   │       │   ├── QDDETWBHJYC.txt
│   │       │   ├── QTDYYIFPHAU.txt
│   │       │   ├── QVNJULGXNUM.txt
│   │       │   ├── REAXWSOIQDY.txt
│   │       │   ├── ROICPTWKXDX.txt
│   │       │   ├── RSXOTNGKBML.txt
│   │       │   ├── RXDARIDGKBF.txt
│   │       │   ├── RYNXFYXMKHG.txt
│   │       │   ├── TAKNAVDMZKV.txt
│   │       │   ├── THPNEGKTJWI.txt
│   │       │   ├── TJFMLJODVAD.txt
│   │       │   ├── TKCZSFQNJTX.txt
│   │       │   ├── TWUOYFCCYBQ.txt
│   │       │   ├── WFSKPTXPFCH.txt
│   │       │   ├── WHTOHQUWXIN.txt
│   │       │   ├── WNJISWPEBRS.txt
│   │       │   ├── WXDJDOGZEHN.txt
│   │       │   └── WYDLGSGGXKV.txt
│   │       ├── Instructions.txt
│   │       ├── One/
│   │       │   ├── HDOHZHFSTTK.txt
│   │       │   ├── HFUTPPAXDIS.txt
│   │       │   ├── HMNZTLIFGPD.txt
│   │       │   ├── HRQFTHKVJTL.txt
│   │       │   ├── HVUTZEVMSBW.txt
│   │       │   ├── JDLRVFCXYLU.txt
│   │       │   ├── JEHBLZPUPSP.txt
│   │       │   ├── JLTXKIGCWDL.txt
│   │       │   ├── JQUOBKFUACN.txt
│   │       │   ├── JTHSNBNPQSE.txt
│   │       │   ├── KCXGNQCZBLO.txt
│   │       │   ├── KFIUZFERLET.txt
│   │       │   ├── KMMLGJOWLGI.txt
│   │       │   ├── KNBSKDREHQU.txt
│   │       │   ├── KTXDHIOKAUI.txt
│   │       │   ├── LDGOCUQJNNS.txt
│   │       │   ├── LFEATJAAYDC.txt
│   │       │   ├── LHODFIKVTQA.txt
│   │       │   ├── LIFDHOFKWOI.txt
│   │       │   ├── LPNDVDXPZIG.txt
│   │       │   ├── PDJMSMNKIRM.txt
│   │       │   ├── PHWAVPEKAER.txt
│   │       │   ├── PLYCGPVEAWO.txt
│   │       │   ├── PQNVCVJINAR.txt
│   │       │   └── PTOBBCJYURJ.txt
│   │       ├── Three/
│   │       │   ├── VAQIJTDOFUJ.txt
│   │       │   ├── VCFJCGJFBIH.txt
│   │       │   ├── VSXFSTABZDY.txt
│   │       │   ├── VVHFVZUNLOO.txt
│   │       │   ├── VVKGWLRMHLU.txt
│   │       │   ├── XAJMCPEWFNI.txt
│   │       │   ├── XFHJOTNPEJG.txt
│   │       │   ├── XHZPVUQTXIO.txt
│   │       │   ├── XJCWENFFGHB.txt
│   │       │   ├── XVMPVSVYKFR.txt
│   │       │   ├── YCESZHJDBXH.txt
│   │       │   ├── YDQFMWXOUMW.txt
│   │       │   ├── YQBIUHSUEVW.txt
│   │       │   ├── YQRNCMNFFHW.txt
│   │       │   ├── YYIZGBTQHZP.txt
│   │       │   ├── ZEZKKRBIZEB.txt
│   │       │   ├── ZKQJXAYKPVD.txt
│   │       │   ├── ZOWVXWPOGWP.txt
│   │       │   ├── ZXEZRQXZNPG.txt
│   │       │   └── ZXIBJMPROKW.txt
│   │       └── Two/
│   │           ├── GKQBQRCTNNK.txt
│   │           ├── GMMQQUBMJNR.txt
│   │           ├── GQTJJORZBXY.txt
│   │           ├── GTOTCIWMDBY.txt
│   │           ├── GXYSEPAFRTP.txt
│   │           ├── HARDNJGDRBC.txt
│   │           ├── HEORIXOTANT.txt
│   │           ├── HMUTDOVNYTV.txt
│   │           ├── HMZXPBOPRAE.txt
│   │           ├── HTOHSTYXTCO.txt
│   │           ├── LCJZYDHBFRM.txt
│   │           ├── LSQSTGPIGIY.txt
│   │           ├── LULTNYAQEJG.txt
│   │           ├── LVMBINRBJXL.txt
│   │           ├── LYZEQCVYNEZ.txt
│   │           ├── OHZOUOSFJQC.txt
│   │           ├── OIHMLGMWTHL.txt
│   │           ├── OKWFOOYTXFU.txt
│   │           ├── OMWIMVRCMYM.txt
│   │           ├── OYMAGXAGWHJ.txt
│   │           ├── SIKFPPLCJDN.txt
│   │           ├── SJMJLDGPBSJ.txt
│   │           ├── SOFUJYXTIMK.txt
│   │           ├── SPDZYGDHEWO.txt
│   │           └── SWOFXREEHWA.txt
│   └── Example_Top_Level/
│       ├── Mid-Example-One/
│       │   ├── Bottom-Level-One/
│       │   │   └── One_Text.txt
│       │   ├── Bottom-Level-Two/
│       │   │   └── Bottom-Text-Two.txt
│       │   └── Mid-Level-Doc.txt
│       └── Mid-Example.txt
├── 13-Web-Scraping/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Guide-to-Web-Scraping-checkpoint.ipynb
│   │   ├── 01-Web-Scraping-Exercises-checkpoint.ipynb
│   │   └── 02-Web-Scraping-Exercise-Solutions-checkpoint.ipynb
│   ├── 00-Guide-to-Web-Scraping.ipynb
│   ├── 01-Web-Scraping-Exercises.ipynb
│   └── 02-Web-Scraping-Exercise-Solutions.ipynb
├── 14-Working-with-Images/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Overview-of-Working-with-Images-checkpoint.ipynb
│   │   ├── 01-Image-Exercise-checkpoint.ipynb
│   │   └── 02-Image-Exercise-Solution-checkpoint.ipynb
│   ├── 00-Overview-of-Working-with-Images.ipynb
│   ├── 01-Image-Exercise.ipynb
│   └── 02-Image-Exercise-Solution.ipynb
├── 15-PDFs-and-Spreadsheets/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Working-with-CSV-Files-checkpoint.ipynb
│   │   ├── 01-Working-with-PDFs-checkpoint.ipynb
│   │   ├── 02-PDFs-Spreadsheets-Puzzle-checkpoint.ipynb
│   │   └── 03-PDFs-Spreadsheets-Puzzle-Solution-checkpoint.ipynb
│   ├── 00-Working-with-CSV-Files.ipynb
│   ├── 01-Working-with-PDFs.ipynb
│   ├── 02-PDFs-Spreadsheets-Puzzle.ipynb
│   ├── 03-PDFs-Spreadsheets-Puzzle-Solution.ipynb
│   ├── Exercise_Files/
│   │   └── find_the_link.csv
│   ├── example.csv
│   ├── makeup_new.csv
│   └── to_save_file.csv
├── 16-Emailing-with-Python/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Overview-of-Sending-Emails-checkpoint.ipynb
│   │   ├── 01-Overview-of-Received-Emails-checkpoint.ipynb
│   │   └── 02-Exercise-Ideas-checkpoint.ipynb
│   ├── 00-Overview-of-Sending-Emails.ipynb
│   ├── 01-Overview-of-Received-Emails.ipynb
│   └── 02-Exercise-Ideas.ipynb
├── 17-Advanced Python Objects and Data Structures/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Advanced Numbers-checkpoint.ipynb
│   │   ├── 02-Advanced Strings-checkpoint.ipynb
│   │   ├── 03-Advanced Sets-checkpoint.ipynb
│   │   ├── 04-Advanced Dictionaries-checkpoint.ipynb
│   │   ├── 05-Advanced Lists-checkpoint.ipynb
│   │   ├── 06-Advanced Python Objects Test-checkpoint.ipynb
│   │   └── 07-Advanced Python Objects Test - Solutions-checkpoint.ipynb
│   ├── 01-Advanced Numbers.ipynb
│   ├── 02-Advanced Strings.ipynb
│   ├── 03-Advanced Sets.ipynb
│   ├── 04-Advanced Dictionaries.ipynb
│   ├── 05-Advanced Lists.ipynb
│   ├── 06-Advanced Python Objects Test.ipynb
│   ├── 07-Advanced Python Objects Test - Solutions.ipynb
│   └── 08-BONUS - With Statement Context Managers.ipynb
├── 18-Milestone Project - 3/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Final Capstone Project-checkpoint.ipynb
│   │   └── 02-Final Capstone Project Ideas-checkpoint.ipynb
│   ├── 01-Final Capstone Project.ipynb
│   ├── 02-Final Capstone Project Ideas.ipynb
│   └── Projects-Solutions/
│       └── Solution Links.md
├── 19-Bonus Material - Introduction to GUIs/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Interact-checkpoint.ipynb
│   │   ├── 02-Widget Basics-checkpoint.ipynb
│   │   ├── 03-Widget List-checkpoint.ipynb
│   │   ├── 04-Widget Events-checkpoint.ipynb
│   │   ├── 05-Widget Styling-checkpoint.ipynb
│   │   ├── 06-Custom Widget-checkpoint.ipynb
│   │   ├── 07-Advanced Widget List-checkpoint.ipynb
│   │   └── 08-Advanced Widget Styling with Layout-checkpoint.ipynb
│   ├── 01-Interact.ipynb
│   ├── 02-Widget Basics.ipynb
│   ├── 03-Widget List.ipynb
│   ├── 04-Widget Events.ipynb
│   ├── 05-Widget Styling.ipynb
│   ├── 06-Custom Widget.ipynb
│   ├── 07-Advanced Widget List.ipynb
│   └── 08-Advanced Widget Styling with Layout.ipynb
├── Jupyter (iPython) Notebooks Guide.ipynb
└── README.md

================================================
FILE CONTENTS
================================================

================================================
FILE: .ipynb_checkpoints/Untitled-checkpoint.ipynb
================================================
{
 "cells": [],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 2
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/01-Numbers-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Numbers and more in Python!\n",
    "\n",
    "In this lecture, we will learn about numbers in Python and how to use them.\n",
    "\n",
    "We'll learn about the following topics:\n",
    "\n",
    "    1.) Types of Numbers in Python\n",
    "    2.) Basic Arithmetic\n",
    "    3.) Differences between classic division and floor division\n",
    "    4.) Object Assignment in Python"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Types of numbers\n",
    "\n",
    "Python has various \"types\" of numbers (numeric literals). We'll mainly focus on integers and floating point numbers.\n",
    "\n",
    "Integers are just whole numbers, positive or negative. For example: 2 and -2 are examples of integers.\n",
    "\n",
    "Floating point numbers in Python are notable because they have a decimal point in them, or use an exponential (e) to define the number. For example 2.0 and -2.1 are examples of floating point numbers. 4E2 (4 times 10 to the power of 2) is also an example of a floating point number in Python.\n",
    "\n",
    "Throughout this course we will be mainly working with integers or simple float number types.\n",
    "\n",
    "Here is a table of the two main types we will spend most of our time working with some examples:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table>\n",
    "<tr>\n",
    "    <th>Examples</th> \n",
    "    <th>Number \"Type\"</th>\n",
    "</tr>\n",
    "\n",
    "<tr>\n",
    "    <td>1,2,-5,1000</td>\n",
    "    <td>Integers</td> \n",
    "</tr>\n",
    "\n",
    "<tr>\n",
    "    <td>1.2,-0.5,2e2,3E2</td> \n",
    "    <td>Floating-point numbers</td> \n",
    "</tr>\n",
    " </table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " \n",
    " \n",
    "Now let's start with some basic arithmetic."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Basic Arithmetic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Addition\n",
    "2+1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Subtraction\n",
    "2-1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Multiplication\n",
    "2*2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.5"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Division\n",
    "3/2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Floor Division\n",
    "7//4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Whoa! What just happened? Last time I checked, 7 divided by 4 equals 1.75 not 1!**\n",
    "\n",
    "The reason we get this result is because we are using \"*floor*\" division. The // operator (two forward slashes) truncates the decimal without rounding, and returns an integer result."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**So what if we just want the remainder after division?**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Modulo\n",
    "7%4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4 goes into 7 once, with a remainder of 3. The % operator returns the remainder after division."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Arithmetic continued"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Powers\n",
    "2**3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.0"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Can also do roots this way\n",
    "4**0.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "105"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Order of Operations followed in Python\n",
    "2 + 10 * 10 + 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "156"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Can use parentheses to specify orders\n",
    "(2+10) * (10+3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Variable Assignments\n",
    "\n",
    "Now that we've seen how to use numbers in Python as a calculator let's see how we can assign names and create variables.\n",
    "\n",
    "We use a single equals sign to assign labels to variables. Let's see a few examples of how we can do this."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Let's create an object called \"a\" and assign it the number 5\n",
    "a = 5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now if I call *a* in my Python script, Python will treat it as the number 5."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Adding the objects\n",
    "a+a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What happens on reassignment? Will Python let us write it over?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Reassignment\n",
    "a = 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Check\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Yes! Python allows you to write over assigned variable names. We can also use the variables themselves when doing the reassignment. Here is an example of what I mean:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Check\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Use A to redefine A\n",
    "a = a + a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Check \n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The names you use when creating these labels need to follow a few rules:\n",
    "\n",
    "    1. Names can not start with a number.\n",
    "    2. There can be no spaces in the name, use _ instead.\n",
    "    3. Can't use any of these symbols :'\",<>/?|\\()!@#$%^&*~-+\n",
    "    4. It's considered best practice (PEP8) that names are lowercase.\n",
    "    5. Avoid using the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), \n",
    "       or 'I' (uppercase letter eye) as single character variable names.\n",
    "    6. Avoid using words that have special meaning in Python like \"list\" and \"str\"\n",
    "\n",
    "\n",
    "Using variable names can be a very useful way to keep track of different variables in Python. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Use object names to keep better track of what's going on in your code!\n",
    "my_income = 100\n",
    "\n",
    "tax_rate = 0.1\n",
    "\n",
    "my_taxes = my_income*tax_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.0"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show my taxes!\n",
    "my_taxes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "So what have we learned? We learned some of the basics of numbers in Python. We also learned how to do arithmetic and use Python as a basic calculator. We then wrapped it up with learning about Variable Assignment in Python.\n",
    "\n",
    "Up next we'll learn about Strings!"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/01-Variable Assignment-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Variable Assignment\n",
    "\n",
    "## Rules for variable names\n",
    "* names can not start with a number\n",
    "* names can not contain spaces, use _ intead\n",
    "* names can not contain any of these symbols:\n",
    "\n",
    "      :'\",<>/?|\\!@#%^&*~-+\n",
    "       \n",
    "* it's considered best practice ([PEP8](https://www.python.org/dev/peps/pep-0008/#function-and-variable-names)) that names are lowercase with underscores\n",
    "* avoid using Python built-in keywords like `list` and `str`\n",
    "* avoid using the single characters `l` (lowercase letter el), `O` (uppercase letter oh) and `I` (uppercase letter eye) as they can be confused with `1` and `0`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dynamic Typing\n",
    "\n",
    "Python uses *dynamic typing*, meaning you can reassign variables to different data types. This makes Python very flexible in assigning data types; it differs from other languages that are *statically typed*."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_dogs = 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_dogs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_dogs = ['Sammy', 'Frankie']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Sammy', 'Frankie']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_dogs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Pros and Cons of Dynamic Typing\n",
    "#### Pros of Dynamic Typing\n",
    "* very easy to work with\n",
    "* faster development time\n",
    "\n",
    "#### Cons of Dynamic Typing\n",
    "* may result in unexpected bugs!\n",
    "* you need to be aware of `type()`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Assigning Variables\n",
    "Variable assignment follows `name = object`, where a single equals sign `=` is an *assignment operator*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we assigned the integer object `5` to the variable name `a`.<br>Let's assign `a` to something else:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can now use `a` in place of the number `10`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a + a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reassigning Variables\n",
    "Python lets you reassign variables with a reference to the same object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = a + 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There's actually a shortcut for this. Python lets you add, subtract, multiply and divide numbers with reassignment using `+=`, `-=`, `*=`, and `/=`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a += 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a *= 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "60"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Determining variable type with `type()`\n",
    "You can check what type of object is assigned to a variable using Python's built-in `type()` function. Common data types include:\n",
    "* **int** (for integer)\n",
    "* **float**\n",
    "* **str** (for string)\n",
    "* **list**\n",
    "* **tuple**\n",
    "* **dict** (for dictionary)\n",
    "* **set**\n",
    "* **bool** (for Boolean True/False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "int"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = (1,2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tuple"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(a)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Simple Exercise\n",
    "This shows how variables make calculations more readable and easier to follow."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_income = 100\n",
    "tax_rate = 0.1\n",
    "my_taxes = my_income * tax_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.0"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_taxes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Great! You should now understand the basics of variable assignment and reassignment in Python.<br>Up next, we'll learn about strings!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/02-Strings-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Strings"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Strings are used in Python to record text information, such as names. Strings in Python are actually a *sequence*, which basically means Python keeps track of every element in the string as a sequence. For example, Python understands the string \"hello' to be a sequence of letters in a specific order. This means we will be able to use indexing to grab particular letters (like the first letter, or the last letter).\n",
    "\n",
    "This idea of a sequence is an important one in Python and we will touch upon it later on in the future.\n",
    "\n",
    "In this lecture we'll learn about the following:\n",
    "\n",
    "    1.) Creating Strings\n",
    "    2.) Printing Strings\n",
    "    3.) String Indexing and Slicing\n",
    "    4.) String Properties\n",
    "    5.) String Methods\n",
    "    6.) Print Formatting"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Creating a String\n",
    "To create a string in Python you need to use either single quotes or double quotes. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hello'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Single word\n",
    "'hello'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'This is also a string'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Entire phrase \n",
    "'This is also a string'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'String built with double quotes'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We can also use double quote\n",
    "\"String built with double quotes\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-4-da9a34b3dc31>, line 2)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-4-da9a34b3dc31>\"\u001b[1;36m, line \u001b[1;32m2\u001b[0m\n\u001b[1;33m    ' I'm using single quotes, but this will create an error'\u001b[0m\n\u001b[1;37m        ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "# Be careful with quotes!\n",
    "' I'm using single quotes, but this will create an error'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The reason for the error above is because the single quote in <code>I'm</code> stopped the string. You can use combinations of double and single quotes to get the complete statement."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"Now I'm ready to use the single quotes inside a string!\""
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"Now I'm ready to use the single quotes inside a string!\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now let's learn about printing strings!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Printing a String\n",
    "\n",
    "Using Jupyter notebook with just a string in a cell will automatically output strings, but the correct way to display strings in your output is by using a print function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We can simply declare a string\n",
    "'Hello World'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World 2'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Note that we can't output multiple strings this way\n",
    "'Hello World 1'\n",
    "'Hello World 2'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use a print statement to print a string."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World 1\n",
      "Hello World 2\n",
      "Use \n",
      " to print a new line\n",
      "\n",
      "\n",
      "See what I mean?\n"
     ]
    }
   ],
   "source": [
    "print('Hello World 1')\n",
    "print('Hello World 2')\n",
    "print('Use \\n to print a new line')\n",
    "print('\\n')\n",
    "print('See what I mean?')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## String Basics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use a function called len() to check the length of a string!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "11"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len('Hello World')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Python's built-in len() function counts all of the characters in the string, including spaces and punctuation."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## String Indexing\n",
    "We know strings are a sequence, which means Python can use indexes to call parts of the sequence. Let's learn how this works.\n",
    "\n",
    "In Python, we use brackets <code>[]</code> after an object to call its index. We should also note that indexing starts at 0 for Python. Let's create a new object called <code>s</code> and then walk through a few examples of indexing."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Assign s as a string\n",
    "s = 'Hello World'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Check\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World\n"
     ]
    }
   ],
   "source": [
    "# Print the object\n",
    "print(s) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's start indexing!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'H'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show first element (in this case a letter)\n",
    "s[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'e'"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'l'"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[2]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use a <code>:</code> to perform *slicing* which grabs everything up to a designated point. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ello World'"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything past the first term all the way to the length of s which is len(s)\n",
    "s[1:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Note that there is no change to the original s\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hel'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything UP TO the 3rd index\n",
    "s[:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note the above slicing. Here we're telling Python to grab everything from 0 up to 3. It doesn't include the 3rd index. You'll notice this a lot in Python, where statements and are usually in the context of \"up to, but not including\"."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Everything\n",
    "s[:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use negative indexing to go backwards."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'d'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Last letter (one index behind 0 so it loops back around)\n",
    "s[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello Worl'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything but the last letter\n",
    "s[:-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use index and slice notation to grab elements of a sequence by a specified step size (the default is 1). For instance we can use two colons in a row and then a number specifying the frequency to grab elements. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything, but go in steps size of 1\n",
    "s[::1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'HloWrd'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything, but go in step sizes of 2\n",
    "s[::2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'dlroW olleH'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We can use this to print a string backwards\n",
    "s[::-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## String Properties\n",
    "It's important to note that strings have an important property known as *immutability*. This means that once a string is created, the elements within it can not be changed or replaced. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'str' object does not support item assignment",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-26-976942677f11>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;31m# Let's try to change the first letter to 'x'\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0ms\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'x'\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: 'str' object does not support item assignment"
     ]
    }
   ],
   "source": [
    "# Let's try to change the first letter to 'x'\n",
    "s[0] = 'x'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice how the error tells us directly what we can't do, change the item assignment!\n",
    "\n",
    "Something we *can* do is concatenate strings!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World concatenate me!'"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Concatenate strings!\n",
    "s + ' concatenate me!'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# We can reassign s completely though!\n",
    "s = s + ' concatenate me!'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World concatenate me!\n"
     ]
    }
   ],
   "source": [
    "print(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World concatenate me!'"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use the multiplication symbol to create repetition!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "letter = 'z'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'zzzzzzzzzz'"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "letter*10"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Basic Built-in String methods\n",
    "\n",
    "Objects in Python usually have built-in methods. These methods are functions inside the object (we will learn about these in much more depth later) that can perform actions or commands on the object itself.\n",
    "\n",
    "We call methods with a period and then the method name. Methods are in the form:\n",
    "\n",
    "object.method(parameters)\n",
    "\n",
    "Where parameters are extra arguments we can pass into the method. Don't worry if the details don't make 100% sense right now. Later on we will be creating our own objects and functions!\n",
    "\n",
    "Here are some examples of built-in methods in strings:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World concatenate me!'"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'HELLO WORLD CONCATENATE ME!'"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Upper Case a string\n",
    "s.upper()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hello world concatenate me!'"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Lower case\n",
    "s.lower()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Hello', 'World', 'concatenate', 'me!']"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Split a string by blank space (this is the default)\n",
    "s.split()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Hello ', 'orld concatenate me!']"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Split by a specific element (doesn't include the element that was split on)\n",
    "s.split('W')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are many more methods than the ones covered here. Visit the Advanced String section to find out more!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Print Formatting\n",
    "\n",
    "We can use the .format() method to add formatted objects to printed string statements. \n",
    "\n",
    "The easiest way to show this is through an example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Insert another string with curly brackets: The inserted string'"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'Insert another string with curly brackets: {}'.format('The inserted string')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We will revisit this string formatting topic in later sections when we are building our projects!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Next up: Lists!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/03-Print Formatting with Strings-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# String Formatting\n",
    "\n",
    "String formatting lets you inject items into a string rather than trying to chain items together using commas or string concatenation. As a quick comparison, consider:\n",
    "\n",
    "    player = 'Thomas'\n",
    "    points = 33\n",
    "    \n",
    "    'Last night, '+player+' scored '+str(points)+' points.'  # concatenation\n",
    "    \n",
    "    f'Last night, {player} scored {points} points.'          # string formatting\n",
    "\n",
    "\n",
    "There are three ways to perform string formatting.\n",
    "* The oldest method involves placeholders using the modulo `%` character.\n",
    "* An improved technique uses the `.format()` string method.\n",
    "* The newest method, introduced with Python 3.6, uses formatted string literals, called *f-strings*.\n",
    "\n",
    "Since you will likely encounter all three versions in someone else's code, we describe each of them here."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Formatting with placeholders\n",
    "You can use <code>%s</code> to inject strings into your print statements. The modulo `%` is referred to as a \"string formatting operator\"."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I'm going to inject something here.\n"
     ]
    }
   ],
   "source": [
    "print(\"I'm going to inject %s here.\" %'something')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can pass multiple items by placing them inside a tuple after the `%` operator."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I'm going to inject some text here, and more text here.\n"
     ]
    }
   ],
   "source": [
    "print(\"I'm going to inject %s text here, and %s text here.\" %('some','more'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can also pass variable names:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I'm going to inject some text here, and more text here.\n"
     ]
    }
   ],
   "source": [
    "x, y = 'some', 'more'\n",
    "print(\"I'm going to inject %s text here, and %s text here.\"%(x,y))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Format conversion methods.\n",
    "It should be noted that two methods <code>%s</code> and <code>%r</code> convert any python object to a string using two separate methods: `str()` and `repr()`. We will learn more about these functions later on in the course, but you should note that `%r` and `repr()` deliver the *string representation* of the object, including quotation marks and any escape characters."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "He said his name was Fred.\n",
      "He said his name was 'Fred'.\n"
     ]
    }
   ],
   "source": [
    "print('He said his name was %s.' %'Fred')\n",
    "print('He said his name was %r.' %'Fred')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As another example, `\\t` inserts a tab into a string."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I once caught a fish this \tbig.\n",
      "I once caught a fish 'this \\tbig'.\n"
     ]
    }
   ],
   "source": [
    "print('I once caught a fish %s.' %'this \\tbig')\n",
    "print('I once caught a fish %r.' %'this \\tbig')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `%s` operator converts whatever it sees into a string, including integers and floats. The `%d` operator converts numbers to integers first, without rounding. Note the difference below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I wrote 3.75 programs today.\n",
      "I wrote 3 programs today.\n"
     ]
    }
   ],
   "source": [
    "print('I wrote %s programs today.' %3.75)\n",
    "print('I wrote %d programs today.' %3.75)   "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Padding and Precision of Floating Point Numbers\n",
    "Floating point numbers use the format <code>%5.2f</code>. Here, <code>5</code> would be the minimum number of characters the string should contain; these may be padded with whitespace if the entire number does not have this many digits. Next to this, <code>.2f</code> stands for how many numbers to show past the decimal point. Let's see some examples:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers: 13.14\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %5.2f' %(13.144))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers: 13\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %1.0f' %(13.144))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers: 13.14400\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %1.5f' %(13.144))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers:      13.14\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %10.2f' %(13.144))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers:                     13.14\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %25.2f' %(13.144))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For more information on string formatting with placeholders visit https://docs.python.org/3/library/stdtypes.html#old-string-formatting"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Multiple Formatting\n",
    "Nothing prohibits using more than one conversion tool in the same print statement:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "First: hi!, Second:  3.14, Third: 'bye!'\n"
     ]
    }
   ],
   "source": [
    "print('First: %s, Second: %5.2f, Third: %r' %('hi!',3.1415,'bye!'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Formatting with the `.format()` method\n",
    "A better way to format objects into your strings for print statements is with the string `.format()` method. The syntax is:\n",
    "\n",
    "    'String here {} then also {}'.format('something1','something2')\n",
    "    \n",
    "For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This is a string with an insert\n"
     ]
    }
   ],
   "source": [
    "print('This is a string with an {}'.format('insert'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### The .format() method has several advantages over the %s placeholder method:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1. Inserted objects can be called by index position:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The quick brown fox\n"
     ]
    }
   ],
   "source": [
    "print('The {2} {1} {0}'.format('fox','brown','quick'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2. Inserted objects can be assigned keywords:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "First Object: 1, Second Object: Two, Third Object: 12.3\n"
     ]
    }
   ],
   "source": [
    "print('First Object: {a}, Second Object: {b}, Third Object: {c}'.format(a=1,b='Two',c=12.3))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3. Inserted objects can be reused, avoiding duplication:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A penny saved is a penny earned.\n",
      "A penny saved is a penny earned.\n"
     ]
    }
   ],
   "source": [
    "print('A %s saved is a %s earned.' %('penny','penny'))\n",
    "# vs.\n",
    "print('A {p} saved is a {p} earned.'.format(p='penny'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Alignment, padding and precision with `.format()`\n",
    "Within the curly braces you can assign field lengths, left/right alignments, rounding parameters and more"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fruit    | Quantity \n",
      "Apples   |       3.0\n",
      "Oranges  |        10\n"
     ]
    }
   ],
   "source": [
    "print('{0:8} | {1:9}'.format('Fruit', 'Quantity'))\n",
    "print('{0:8} | {1:9}'.format('Apples', 3.))\n",
    "print('{0:8} | {1:9}'.format('Oranges', 10))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "By default, `.format()` aligns text to the left, numbers to the right. You can pass an optional `<`,`^`, or `>` to set a left, center or right alignment:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Left     |  Center  |    Right\n",
      "11       |    22    |       33\n"
     ]
    }
   ],
   "source": [
    "print('{0:<8} | {1:^8} | {2:>8}'.format('Left','Center','Right'))\n",
    "print('{0:<8} | {1:^8} | {2:>8}'.format(11,22,33))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can precede the aligment operator with a padding character"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Left==== | -Center- | ...Right\n",
      "11====== | ---22--- | ......33\n"
     ]
    }
   ],
   "source": [
    "print('{0:=<8} | {1:-^8} | {2:.>8}'.format('Left','Center','Right'))\n",
    "print('{0:=<8} | {1:-^8} | {2:.>8}'.format(11,22,33))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Field widths and float precision are handled in a way similar to placeholders. The following two print statements are equivalent:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This is my ten-character, two-decimal number:     13.58\n",
      "This is my ten-character, two-decimal number:     13.58\n"
     ]
    }
   ],
   "source": [
    "print('This is my ten-character, two-decimal number:%10.2f' %13.579)\n",
    "print('This is my ten-character, two-decimal number:{0:10.2f}'.format(13.579))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that there are 5 spaces following the colon, and 5 characters taken up by 13.58, for a total of ten characters.\n",
    "\n",
    "For more information on the string `.format()` method visit https://docs.python.org/3/library/string.html#formatstrings"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Formatted String Literals (f-strings)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Introduced in Python 3.6, f-strings offer several benefits over the older `.format()` string method described above. For one, you can bring outside variables immediately into to the string rather than pass them as arguments through `.format(var)`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "He said his name is Fred.\n"
     ]
    }
   ],
   "source": [
    "name = 'Fred'\n",
    "\n",
    "print(f\"He said his name is {name}.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Pass `!r` to get the string representation:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "He said his name is 'Fred'\n"
     ]
    }
   ],
   "source": [
    "print(f\"He said his name is {name!r}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Float formatting follows `\"result: {value:{width}.{precision}}\"`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Where with the `.format()` method you might see `{value:10.4f}`, with f-strings this can become `{value:{10}.{6}}`\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "My 10 character, four decimal number is:   23.4568\n",
      "My 10 character, four decimal number is:   23.4568\n"
     ]
    }
   ],
   "source": [
    "num = 23.45678\n",
    "print(\"My 10 character, four decimal number is:{0:10.4f}\".format(num))\n",
    "print(f\"My 10 character, four decimal number is:{num:{10}.{6}}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that with f-strings, *precision* refers to the total number of digits, not just those following the decimal. This fits more closely with scientific notation and statistical analysis. Unfortunately, f-strings do not pad to the right of the decimal, even if precision allows it:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "My 10 character, four decimal number is:   23.4500\n",
      "My 10 character, four decimal number is:     23.45\n"
     ]
    }
   ],
   "source": [
    "num = 23.45\n",
    "print(\"My 10 character, four decimal number is:{0:10.4f}\".format(num))\n",
    "print(f\"My 10 character, four decimal number is:{num:{10}.{6}}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If this becomes important, you can always use `.format()` method syntax inside an f-string:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "My 10 character, four decimal number is:   23.4500\n",
      "My 10 character, four decimal number is:   23.4500\n"
     ]
    }
   ],
   "source": [
    "num = 23.45\n",
    "print(\"My 10 character, four decimal number is:{0:10.4f}\".format(num))\n",
    "print(f\"My 10 character, four decimal number is:{num:10.4f}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For more info on formatted string literals visit https://docs.python.org/3/reference/lexical_analysis.html#f-strings"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That is the basics of string formatting!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/04-Lists-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Lists\n",
    "\n",
    "Earlier when discussing strings we introduced the concept of a *sequence* in Python. Lists can be thought of the most general version of a *sequence* in Python. Unlike strings, they are mutable, meaning the elements inside a list can be changed!\n",
    "\n",
    "In this section we will learn about:\n",
    "    \n",
    "    1.) Creating lists\n",
    "    2.) Indexing and Slicing Lists\n",
    "    3.) Basic List Methods\n",
    "    4.) Nesting Lists\n",
    "    5.) Introduction to List Comprehensions\n",
    "\n",
    "Lists are constructed with brackets [] and commas separating every element in the list.\n",
    "\n",
    "Let's go ahead and see how we can construct lists!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Assign a list to an variable named my_list\n",
    "my_list = [1,2,3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We just created a list of integers, but lists can actually hold different object types. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_list = ['A string',23,100.232,'o']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Just like strings, the len() function will tell you how many items are in the sequence of the list."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(my_list)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Indexing and Slicing\n",
    "Indexing and slicing work just like in strings. Let's make a new list to remind ourselves of how this works:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_list = ['one','two','three',4,5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'one'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab element at index 0\n",
    "my_list[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['two', 'three', 4, 5]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab index 1 and everything past it\n",
    "my_list[1:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['one', 'two', 'three']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything UP TO index 3\n",
    "my_list[:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use + to concatenate lists, just like we did for strings."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['one', 'two', 'three', 4, 5, 'new item']"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_list + ['new item']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note: This doesn't actually change the original list!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['one', 'two', 'three', 4, 5]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You would have to reassign the list to make the change permanent."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Reassign\n",
    "my_list = my_list + ['add new item permanently']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['one', 'two', 'three', 4, 5, 'add new item permanently']"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use the * for a duplication method similar to strings:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['one',\n",
       " 'two',\n",
       " 'three',\n",
       " 4,\n",
       " 5,\n",
       " 'add new item permanently',\n",
       " 'one',\n",
       " 'two',\n",
       " 'three',\n",
       " 4,\n",
       " 5,\n",
       " 'add new item permanently']"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Make the list double\n",
    "my_list * 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['one', 'two', 'three', 4, 5, 'add new item permanently']"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Again doubling not permanent\n",
    "my_list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Basic List Methods\n",
    "\n",
    "If you are familiar with another programming language, you might start to draw parallels between arrays in another language and lists in Python. Lists in Python however, tend to be more flexible than arrays in other languages for a two good reasons: they have no fixed size (meaning we don't have to specify how big a list will be), and they have no fixed type constraint (like we've seen above).\n",
    "\n",
    "Let's go ahead and explore some more special methods for lists:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Create a new list\n",
    "list1 = [1,2,3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Use the **append** method to permanently add an item to the end of a list:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Append\n",
    "list1.append('append me!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3, 'append me!']"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show\n",
    "list1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Use **pop** to \"pop off\" an item from the list. By default pop takes off the last index, but you can also specify which index to pop off. Let's see an example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Pop off the 0 indexed item\n",
    "list1.pop(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[2, 3, 'append me!']"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show\n",
    "list1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Assign the popped element, remember default popped index is -1\n",
    "popped_item = list1.pop()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'append me!'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "popped_item"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[2, 3]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show remaining list\n",
    "list1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "It should also be noted that lists indexing will return an error if there is no element at that index. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "ename": "IndexError",
     "evalue": "list index out of range",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-22-af6d2015fa1f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mlist1\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m100\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m: list index out of range"
     ]
    }
   ],
   "source": [
    "list1[100]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use the **sort** method and the **reverse** methods to also effect your lists:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "new_list = ['a','e','x','b','c']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['a', 'e', 'x', 'b', 'c']"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Show\n",
    "new_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Use reverse to reverse order (this is permanent!)\n",
    "new_list.reverse()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['c', 'b', 'x', 'e', 'a']"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Use sort to sort the list (in this case alphabetical order, but for numbers it will go ascending)\n",
    "new_list.sort()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['a', 'b', 'c', 'e', 'x']"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_list"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Nesting Lists\n",
    "A great feature of of Python data structures is that they support *nesting*. This means we can have data structures within data structures. For example: A list inside a list.\n",
    "\n",
    "Let's see how this works!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Let's make three lists\n",
    "lst_1=[1,2,3]\n",
    "lst_2=[4,5,6]\n",
    "lst_3=[7,8,9]\n",
    "\n",
    "# Make a list of lists to form a matrix\n",
    "matrix = [lst_1,lst_2,lst_3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show\n",
    "matrix"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can again use indexing to grab elements, but now there are two levels for the index. The items in the matrix object, and then the items inside that list!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab first item in matrix object\n",
    "matrix[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab first item of the first item in the matrix object\n",
    "matrix[0][0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# List Comprehensions\n",
    "Python has an advanced feature called list comprehensions. They allow for quick construction of lists. To fully understand list comprehensions we need to understand for loops. So don't worry if you don't completely understand this section, and feel free to just skip it since we will return to this topic later.\n",
    "\n",
    "But in case you want to know now, here are a few examples!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Build a list comprehension by deconstructing a for loop within a []\n",
    "first_col = [row[0] for row in matrix]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 4, 7]"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first_col"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We used a list comprehension here to grab the first element of every row in the matrix object. We will cover this in much more detail later on!\n",
    "\n",
    "For more advanced methods and features of lists in Python, check out the Advanced Lists section later on in this course!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/05-Dictionaries-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Dictionaries\n",
    "\n",
    "We've been learning about *sequences* in Python but now we're going to switch gears and learn about *mappings* in Python. If you're familiar with other languages you can think of these Dictionaries as hash tables. \n",
    "\n",
    "This section will serve as a brief introduction to dictionaries and consist of:\n",
    "\n",
    "    1.) Constructing a Dictionary\n",
    "    2.) Accessing objects from a dictionary\n",
    "    3.) Nesting Dictionaries\n",
    "    4.) Basic Dictionary Methods\n",
    "\n",
    "So what are mappings? Mappings are a collection of objects that are stored by a *key*, unlike a sequence that stored objects by their relative position. This is an important distinction, since mappings won't retain order since they have objects defined by a key.\n",
    "\n",
    "A Python dictionary consists of a key and then an associated value. That value can be almost any Python object.\n",
    "\n",
    "\n",
    "## Constructing a Dictionary\n",
    "Let's see how we can construct dictionaries to get a better understanding of how they work!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Make a dictionary with {} and : to signify a key and a value\n",
    "my_dict = {'key1':'value1','key2':'value2'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'value2'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Call values by their key\n",
    "my_dict['key2']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Its important to note that dictionaries are very flexible in the data types they can hold. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_dict = {'key1':123,'key2':[12,23,33],'key3':['item0','item1','item2']}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['item0', 'item1', 'item2']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Let's call items from the dictionary\n",
    "my_dict['key3']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'item0'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Can call an index on that value\n",
    "my_dict['key3'][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ITEM0'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Can then even call methods on that value\n",
    "my_dict['key3'][0].upper()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can affect the values of a key as well. For instance:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "123"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_dict['key1']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Subtract 123 from the value\n",
    "my_dict['key1'] = my_dict['key1'] - 123"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Check\n",
    "my_dict['key1']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A quick note, Python has a built-in method of doing a self subtraction or addition (or multiplication or division). We could have also used += or -= for the above statement. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-123"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Set the object equal to itself minus 123 \n",
    "my_dict['key1'] -= 123\n",
    "my_dict['key1']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also create keys by assignment. For instance if we started off with an empty dictionary, we could continually add to it:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Create a new dictionary\n",
    "d = {}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Create a new key through assignment\n",
    "d['animal'] = 'Dog'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Can do this with any object\n",
    "d['answer'] = 42"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'animal': 'Dog', 'answer': 42}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Show\n",
    "d"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Nesting with Dictionaries\n",
    "\n",
    "Hopefully you're starting to see how powerful Python is with its flexibility of nesting objects and calling methods on them. Let's see a dictionary nested inside a dictionary:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Dictionary nested inside a dictionary nested inside a dictionary\n",
    "d = {'key1':{'nestkey':{'subnestkey':'value'}}}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Wow! That's a quite the inception of dictionaries! Let's see how we can grab that value:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'value'"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Keep calling the keys\n",
    "d['key1']['nestkey']['subnestkey']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## A few Dictionary Methods\n",
    "\n",
    "There are a few methods we can call on a dictionary. Let's get a quick introduction to a few of them:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Create a typical dictionary\n",
    "d = {'key1':1,'key2':2,'key3':3}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['key1', 'key2', 'key3'])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Method to return a list of all keys \n",
    "d.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_values([1, 2, 3])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Method to grab all values\n",
    "d.values()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_items([('key1', 1), ('key2', 2), ('key3', 3)])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Method to return tuples of all items  (we'll learn about tuples soon)\n",
    "d.items()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Hopefully you now have a good basic understanding how to construct dictionaries. There's a lot more to go into here, but we will revisit dictionaries at later time. After this section all you need to know is how to create a dictionary and how to retrieve values from it."
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/06-Tuples-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Tuples\n",
    "\n",
    "In Python tuples are very similar to lists, however, unlike lists they are *immutable* meaning they can not be changed. You would use tuples to present things that shouldn't be changed, such as days of the week, or dates on a calendar. \n",
    "\n",
    "In this section, we will get a brief overview of the following:\n",
    "\n",
    "    1.) Constructing Tuples\n",
    "    2.) Basic Tuple Methods\n",
    "    3.) Immutability\n",
    "    4.) When to Use Tuples\n",
    "\n",
    "You'll have an intuition of how to use tuples based on what you've learned about lists. We can treat them very similarly with the major distinction being that tuples are immutable.\n",
    "\n",
    "## Constructing Tuples\n",
    "\n",
    "The construction of a tuples use () with elements separated by commas. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Create a tuple\n",
    "t = (1,2,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Check len just like a list\n",
    "len(t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('one', 2)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Can also mix object types\n",
    "t = ('one',2)\n",
    "\n",
    "# Show\n",
    "t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'one'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Use indexing just like we did in lists\n",
    "t[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Slicing just like a list\n",
    "t[-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Basic Tuple Methods\n",
    "\n",
    "Tuples have built-in methods, but not as many as lists do. Let's look at two of them:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Use .index to enter a value and return the index\n",
    "t.index('one')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Use .count to count the number of times a value appears\n",
    "t.count('one')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Immutability\n",
    "\n",
    "It can't be stressed enough that tuples are immutable. To drive that point home:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'tuple' object does not support item assignment",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-8-1257c0aa9edd>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mt\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m \u001b[1;34m'change'\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: 'tuple' object does not support item assignment"
     ]
    }
   ],
   "source": [
    "t[0]= 'change'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Because of this immutability, tuples can't grow. Once a tuple is made we can not add to it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'tuple' object has no attribute 'append'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-9-b75f5b09ac19>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'nope'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m: 'tuple' object has no attribute 'append'"
     ]
    }
   ],
   "source": [
    "t.append('nope')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## When to use Tuples\n",
    "\n",
    "You may be wondering, \"Why bother using tuples when they have fewer available methods?\" To be honest, tuples are not used as often as lists in programming, but are used when immutability is necessary. If in your program you are passing around an object and need to make sure it does not get changed, then a tuple becomes your solution. It provides a convenient source of data integrity.\n",
    "\n",
    "You should now be able to create and use tuples in your programming as well as have an understanding of their immutability.\n",
    "\n",
    "Up next Files!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/07-Sets and Booleans-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Set and Booleans\n",
    "\n",
    "There are two other object types in Python that we should quickly cover: Sets and Booleans. \n",
    "\n",
    "## Sets\n",
    "\n",
    "Sets are an unordered collection of *unique* elements. We can construct them by using the set() function. Let's go ahead and make a set to see how it works"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x = set()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# We add to sets with the add() method\n",
    "x.add(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Show\n",
    "x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note the curly brackets. This does not indicate a dictionary! Although you can draw analogies as a set being a dictionary with only keys.\n",
    "\n",
    "We know that a set has only unique entries. So what happens when we try to add something that is already in a set?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Add a different element\n",
    "x.add(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1, 2}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Show\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Try to add the same element\n",
    "x.add(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1, 2}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Show\n",
    "x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice how it won't place another 1 there. That's because a set is only concerned with unique elements! We can cast a list with multiple repeat elements to a set to get the unique elements. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Create a list with repeats\n",
    "list1 = [1,1,2,2,3,4,5,6,1,1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1, 2, 3, 4, 5, 6}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Cast as set to get unique values\n",
    "set(list1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Booleans\n",
    "\n",
    "Python  comes with Booleans (with predefined True and False displays that are basically just the integers 1 and 0). It also has a placeholder object called None. Let's walk through a few quick examples of Booleans (we will dive deeper into them later in this course)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Set object to be a boolean\n",
    "a = True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Show\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use comparison operators to create booleans. We will go over all the comparison operators later on in the course."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Output is boolean\n",
    "1 > 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use None as a placeholder for an object that we don't want to reassign yet:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# None placeholder\n",
    "b = None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n"
     ]
    }
   ],
   "source": [
    "# Show\n",
    "print(b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Thats it! You should now have a basic understanding of Python objects and data structure types. Next, go ahead and do the assessment test!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/08-Files-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Files\n",
    "\n",
    "Python uses file objects to interact with external files on your computer. These file objects can be any sort of file you have on your computer, whether it be an audio file, a text file, emails, Excel documents, etc. Note: You will probably need to install certain libraries or modules to interact with those various file types, but they are easily available. (We will cover downloading modules later on in the course).\n",
    "\n",
    "Python has a built-in open function that allows us to open and play with basic file types. First we will need a file though. We're going to use some IPython magic to create a text file!\n",
    "\n",
    "## IPython Writing a File \n",
    "#### This function is specific to jupyter notebooks! Alternatively, quickly create a simple .txt file with sublime text editor."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting test.txt\n"
     ]
    }
   ],
   "source": [
    "%%writefile test.txt\n",
    "Hello, this is a quick test file."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Python Opening a file\n",
    "\n",
    "Let's being by opening the file test.txt that is located in the same directory as this notebook. For now we will work with files located in the same directory as the notebook or .py script you are using.\n",
    "\n",
    "It is very easy to get an error on this step:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: 'whoops.txt'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-dafe28ee473f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mmyfile\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'whoops.txt'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'whoops.txt'"
     ]
    }
   ],
   "source": [
    "myfile = open('whoops.txt')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To avoid this error,make sure your .txt file is saved in the same location as your notebook, to check your notebook location, use **pwd**:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Marcial\\\\Pierian-Data-Courses\\\\Complete-Python-3-Bootcamp\\\\00-Python Object and Data Structure Basics'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pwd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Alternatively, to grab files from any location on your computer, simply pass in the entire file path. **\n",
    "\n",
    "For Windows you need to use double \\ so python doesn't treat the second \\ as an escape character, a file path is in the form:\n",
    "\n",
    "    myfile = open(\"C:\\\\Users\\\\YourUserName\\\\Home\\\\Folder\\\\myfile.txt\")\n",
    "\n",
    "For MacOS and Linux you use slashes in the opposite direction:\n",
    "\n",
    "    myfile = open(\"/Users/YouUserName/Folder/myfile.txt\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Open the text.txt we made earlier\n",
    "my_file = open('test.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello, this is a quick test file.'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We can now read the file\n",
    "my_file.read()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# But what happens if we try to read it again?\n",
    "my_file.read()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This happens because you can imagine the reading \"cursor\" is at the end of the file after having read it. So there is nothing left to read. We can reset the \"cursor\" like this:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Seek to the start of file (index 0)\n",
    "my_file.seek(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello, this is a quick test file.'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Now read again\n",
    "my_file.read()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can read a file line by line using the readlines method. Use caution with large files, since everything will be held in memory. We will learn how to iterate over large files later in the course."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Hello, this is a quick test file.']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Readlines returns a list of the lines in the file\n",
    "my_file.seek(0)\n",
    "my_file.readlines()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When you have finished using a file, it is always good practice to close it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_file.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Writing to a File\n",
    "\n",
    "By default, the `open()` function will only allow us to read the file. We need to pass the argument `'w'` to write over the file. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Add a second argument to the function, 'w' which stands for write.\n",
    "# Passing 'w+' lets us read and write to the file\n",
    "\n",
    "my_file = open('test.txt','w+')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### <strong><font color='red'>Use caution!</font></strong> \n",
    "Opening a file with `'w'` or `'w+'` truncates the original, meaning that anything that was in the original file **is deleted**!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "18"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Write to the file\n",
    "my_file.write('This is a new line')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'This is a new line'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Read the file\n",
    "my_file.seek(0)\n",
    "my_file.read()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_file.close()  # always do this when you're done with a file"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Appending to a File\n",
    "Passing the argument `'a'` opens the file and puts the pointer at the end, so anything written is appended. Like `'w+'`, `'a+'` lets us read and write to a file. If the file does not exist, one will be created."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "23"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_file = open('test.txt','a+')\n",
    "my_file.write('\\nThis is text being appended to test.txt')\n",
    "my_file.write('\\nAnd another line here.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This is a new line\n",
      "This is text being appended to test.txt\n",
      "And another line here.\n"
     ]
    }
   ],
   "source": [
    "my_file.seek(0)\n",
    "print(my_file.read())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_file.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Appending with `%%writefile`\n",
    "We can do the same thing using IPython cell magic:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Appending to test.txt\n"
     ]
    }
   ],
   "source": [
    "%%writefile -a test.txt\n",
    "\n",
    "This is text being appended to test.txt\n",
    "And another line here."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Add a blank space if you want the first line to begin on its own line, as Jupyter won't recognize escape sequences like `\\n`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Iterating through a File\n",
    "\n",
    "Lets get a quick preview of a for loop by iterating over a text file. First let's make a new text file with some IPython Magic:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting test.txt\n"
     ]
    }
   ],
   "source": [
    "%%writefile test.txt\n",
    "First Line\n",
    "Second Line"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can use a little bit of flow to tell the program to for through every line of the file and do something:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "First Line\n",
      "\n",
      "Second Line\n"
     ]
    }
   ],
   "source": [
    "for line in open('test.txt'):\n",
    "    print(line)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Don't worry about fully understanding this yet, for loops are coming up soon. But we'll break down what we did above. We said that for every line in this text file, go ahead and print that line. It's important to note a few things here:\n",
    "\n",
    "1. We could have called the \"line\" object anything (see example below).\n",
    "2. By not calling `.read()` on the file, the whole text file was not stored in memory.\n",
    "3. Notice the indent on the second line for print. This whitespace is required in Python."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "First Line\n",
      "\n",
      "Second Line\n"
     ]
    }
   ],
   "source": [
    "# Pertaining to the first point above\n",
    "for asdf in open('test.txt'):\n",
    "    print(asdf)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We'll learn a lot more about this later, but up next: Sets and Booleans!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/09-Objects and Data Structures Assessment Test-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>\n",
    "# Objects and Data Structures Assessment Test"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Test your knowledge. \n",
    "\n",
    "** Answer the following questions **"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Write (or just say out loud to yourself) a brief description of all the following Object Types and Data Structures we've learned about. You can edit the cell below by double clicking on it. Really this is just to test if you know the difference between these, so feel free to just think about it, since your answers are self-graded."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Double Click HERE to edit this markdown cell and write answers.\n",
    "\n",
    "Numbers:\n",
    "\n",
    "Strings:\n",
    "\n",
    "Lists:\n",
    "\n",
    "Tuples:\n",
    "\n",
    "Dictionaries:\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Numbers\n",
    "\n",
    "Write an equation that uses multiplication, division, an exponent, addition, and subtraction that is equal to 100.25.\n",
    "\n",
    "Hint: This is just to test your memory of the basic arithmetic commands, work backwards from 100.25"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Answer these 3 questions without typing code. Then type code to check your answer.\n",
    "\n",
    "    What is the value of the expression 4 * (6 + 5)\n",
    "    \n",
    "    What is the value of the expression 4 * 6 + 5 \n",
    "    \n",
    "    What is the value of the expression 4 + 6 * 5 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What is the *type* of the result of the expression 3 + 1.5 + 4?<br><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What would you use to find a number’s square root, as well as its square? "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Square root:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Square:\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Strings"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Given the string 'hello' give an index command that returns 'e'. Enter your code in the cell below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s = 'hello'\n",
    "# Print out 'e' using indexing\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reverse the string 'hello' using slicing:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s ='hello'\n",
    "# Reverse the string using slicing\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Given the string hello, give two methods of producing the letter 'o' using indexing."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s ='hello'\n",
    "# Print out the 'o'\n",
    "\n",
    "# Method 1:\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Method 2:\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Lists"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Build this list [0,0,0] two separate ways."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Method 1:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Method 2:\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reassign 'hello' in this nested list to say 'goodbye' instead:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "list3 = [1,2,[3,4,'hello']]\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Sort the list below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "list4 = [5,3,4,6,1]\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dictionaries"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Using keys and indexing, grab the 'hello' from the following dictionaries:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "d = {'simple_key':'hello'}\n",
    "# Grab 'hello'\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "d = {'k1':{'k2':'hello'}}\n",
    "# Grab 'hello'\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Getting a little tricker\n",
    "d = {'k1':[{'nest_key':['this is deep',['hello']]}]}\n",
    "\n",
    "#Grab hello\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# This will be hard and annoying!\n",
    "d = {'k1':[1,2,{'k2':['this is tricky',{'tough':[1,2,['hello']]}]}]}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Can you sort a dictionary? Why or why not?<br><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Tuples"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What is the major difference between tuples and lists?<br><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "How do you create a tuple?<br><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sets "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What is unique about a set?<br><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Use a set to find the unique values of the list below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "list5 = [1,2,2,33,4,4,11,22,3,3,2]\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Booleans"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For the following quiz questions, we will get a preview of comparison operators. In the table below, a=3 and b=4.\n",
    "\n",
    "<table class=\"table table-bordered\">\n",
    "<tr>\n",
    "<th style=\"width:10%\">Operator</th><th style=\"width:45%\">Description</th><th>Example</th>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>==</td>\n",
    "<td>If the values of two operands are equal, then the condition becomes true.</td>\n",
    "<td> (a == b) is not true.</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>!=</td>\n",
    "<td>If values of two operands are not equal, then condition becomes true.</td>\n",
    "<td> (a != b) is true.</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>&gt;</td>\n",
    "<td>If the value of left operand is greater than the value of right operand, then condition becomes true.</td>\n",
    "<td> (a &gt; b) is not true.</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>&lt;</td>\n",
    "<td>If the value of left operand is less than the value of right operand, then condition becomes true.</td>\n",
    "<td> (a &lt; b) is true.</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>&gt;=</td>\n",
    "<td>If the value of left operand is greater than or equal to the value of right operand, then condition becomes true.</td>\n",
    "<td> (a &gt;= b) is not true. </td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>&lt;=</td>\n",
    "<td>If the value of left operand is less than or equal to the value of right operand, then condition becomes true.</td>\n",
    "<td> (a &lt;= b) is true. </td>\n",
    "</tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What will be the resulting Boolean of the following pieces of code (answer fist then check by typing it in!)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Answer before running cell\n",
    "2 > 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Answer before running cell\n",
    "3 <= 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Answer before running cell\n",
    "3 == 2.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Answer before running cell\n",
    "3.0 == 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Answer before running cell\n",
    "4**0.5 != 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Final Question: What is the boolean output of the cell block below?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# two nested lists\n",
    "l_one = [1,2,[3,4]]\n",
    "l_two = [1,2,{'k1':4}]\n",
    "\n",
    "# True or False?\n",
    "l_one[2][0] >= l_two[2]['k1']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Great Job on your first assessment! "
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/.ipynb_checkpoints/10-Objects and Data Structures Assessment Test-Solution-checkpoint.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>\n",
    "\n",
    "# Objects and Data Structures Assessment Test"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Test your knowledge. \n",
    "\n",
    "** Answer the following questions **"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Write a brief description of all the following Object Types and Data Structures we've learned about: "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**For the full answers, review the Jupyter notebook introductions of each topic!**\n",
    "\n",
    "[Numbers](http://nbviewer.ipython.org/github/jmportilla/Complete-Python-Bootcamp/blob/master/Numbers.ipynb)\n",
    "\n",
    "[Strings](http://nbviewer.ipython.org/github/jmportilla/Complete-Python-Bootcamp/blob/master/Strings.ipynb)\n",
    "\n",
    "[Lists](http://nbviewer.ipython.org/github/jmportilla/Complete-Python-Bootcamp/blob/master/Lists.ipynb)\n",
    "\n",
    "[Tuples](http://nbviewer.ipython.org/github/jmportilla/Complete-Python-Bootcamp/blob/master/Tuples.ipynb)\n",
    "\n",
    "[Dictionaries](http://nbviewer.ipython.org/github/jmportilla/Complete-Python-Bootcamp/blob/master/Dictionaries.ipynb)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Numbers\n",
    "\n",
    "Write an equation that uses multiplication, division, an exponent, addition, and subtraction that is equal to 100.25.\n",
    "\n",
    "Hint: This is just to test your memory of the basic arithmetic commands, work backwards from 100.25"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100.25"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Your answer is probably different\n",
    "(60 + (10 ** 2) / 4 * 7) - 134.75"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Answer these 3 questions without typing code. Then type code to check your answer.\n",
    "\n",
    "    What is the value of the expression 4 * (6 + 5)\n",
    "    \n",
    "    What is the value of the expression 4 * 6 + 5 \n",
    "    \n",
    "    What is the value of the expression 4 + 6 * 5 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "44"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "4 * (6 + 5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "29"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "4 * 6 + 5 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "34"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "4 + 6 * 5 "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What is the *type* of the result of the expression 3 + 1.5 + 4?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Answer: Floating Point Number**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What would you use to find a number’s square root, as well as its square? "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Square root:\n",
    "100 ** 0.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Square:\n",
    "10 ** 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Strings"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Given the string 'hello' give an index command that returns 'e'. Enter your code in the cell below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'e'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = 'hello'\n",
    "# Print out 'e' using indexing\n",
    "\n",
    "s[1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reverse the string 'hello' using slicing:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'olleh'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s ='hello'\n",
    "# Reverse the string using slicing\n",
    "\n",
    "s[::-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Given the string 'hello', give two methods of producing the letter 'o' using indexing."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'o'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s ='hello'\n",
    "# Print out the 'o'\n",
    "\n",
    "# Method 1:\n",
    "\n",
    "s[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'o'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Method 2:\n",
    "\n",
    "s[4]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Lists"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Build this list [0,0,0] two separate ways."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 0, 0]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Method 1:\n",
    "[0]*3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 0, 0]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Method 2:\n",
    "list2 = [0,0,0]\n",
    "list2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reassign 'hello' in this nested list to say 'goodbye' instead:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "list3 = [1,2,[3,4,'hello']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "list3[2][2] = 'goodbye'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, [3, 4, 'goodbye']]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Sort the list below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "list4 = [5,3,4,6,1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 3, 4, 5, 6]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Method 1:\n",
    "sorted(list4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 3, 4, 5, 6]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Method 2:\n",
    "list4.sort()\n",
    "list4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dictionaries"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Using keys and indexing, grab the 'hello' from the following dictionaries:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hello'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = {'simple_key':'hello'}\n",
    "# Grab 'hello'\n",
    "\n",
    "d['simple_key']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hello'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = {'k1':{'k2':'hello'}}\n",
    "# Grab 'hello'\n",
    "\n",
    "d['k1']['k2']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Getting a little tricker\n",
    "d = {'k1':[{'nest_key':['this is deep',['hello']]}]}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hello'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# This was harder than I expected...\n",
    "d['k1'][0]['nest_key'][1][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# This will be hard and annoying!\n",
    "d = {'k1':[1,2,{'k2':['this is tricky',{'tough':[1,2,['hello']]}]}]}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hello'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Phew!\n",
    "d['k1'][2]['k2'][1]['tough'][2][0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Can you sort a dictionary? Why or why not?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Answer: No! Because normal dictionaries are *mappings* not a sequence. **"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Tuples"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What is the major difference between tuples and lists?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Tuples are immutable!**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "How do you create a tuple?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "t = (1,2,3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sets "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What is unique about a set?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Answer: They don't allow for duplicate items!**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Use a set to find the unique values of the list below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "list5 = [1,2,2,33,4,4,11,22,3,3,2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1, 2, 3, 4, 11, 22, 33}"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "set(list5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Booleans"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For the following quiz questions, we will get a preview of comparison operators. In the table below, a=3 and b=4.\n",
    "\n",
    "<table class=\"table table-bordered\">\n",
    "<tr>\n",
    "<th style=\"width:10%\">Operator</th><th style=\"width:45%\">Description</th><th>Example</th>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>==</td>\n",
    "<td>If the values of two operands are equal, then the condition becomes true.</td>\n",
    "<td> (a == b) is not true.</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>!=</td>\n",
    "<td>If values of two operands are not equal, then condition becomes true.</td>\n",
    "<td> (a != b) is true.</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>&gt;</td>\n",
    "<td>If the value of left operand is greater than the value of right operand, then condition becomes true.</td>\n",
    "<td> (a &gt; b) is not true.</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>&lt;</td>\n",
    "<td>If the value of left operand is less than the value of right operand, then condition becomes true.</td>\n",
    "<td> (a &lt; b) is true.</td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>&gt;=</td>\n",
    "<td>If the value of left operand is greater than or equal to the value of right operand, then condition becomes true.</td>\n",
    "<td> (a &gt;= b) is not true. </td>\n",
    "</tr>\n",
    "<tr>\n",
    "<td>&lt;=</td>\n",
    "<td>If the value of left operand is less than or equal to the value of right operand, then condition becomes true.</td>\n",
    "<td> (a &lt;= b) is true. </td>\n",
    "</tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What will be the resulting Boolean of the following pieces of code (answer fist then check by typing it in!)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Answer before running cell\n",
    "2 > 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Answer before running cell\n",
    "3 <= 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Answer before running cell\n",
    "3 == 2.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Answer before running cell\n",
    "3.0 == 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Answer before running cell\n",
    "4**0.5 != 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Final Question: What is the boolean output of the cell block below?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# two nested lists\n",
    "l_one = [1,2,[3,4]]\n",
    "l_two = [1,2,{'k1':4}]\n",
    "\n",
    "# True or False?\n",
    "l_one[2][0] >= l_two[2]['k1']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Great Job on your first assessment! "
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/01-Numbers.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Numbers and more in Python!\n",
    "\n",
    "In this lecture, we will learn about numbers in Python and how to use them.\n",
    "\n",
    "We'll learn about the following topics:\n",
    "\n",
    "    1.) Types of Numbers in Python\n",
    "    2.) Basic Arithmetic\n",
    "    3.) Differences between classic division and floor division\n",
    "    4.) Object Assignment in Python"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Types of numbers\n",
    "\n",
    "Python has various \"types\" of numbers (numeric literals). We'll mainly focus on integers and floating point numbers.\n",
    "\n",
    "Integers are just whole numbers, positive or negative. For example: 2 and -2 are examples of integers.\n",
    "\n",
    "Floating point numbers in Python are notable because they have a decimal point in them, or use an exponential (e) to define the number. For example 2.0 and -2.1 are examples of floating point numbers. 4E2 (4 times 10 to the power of 2) is also an example of a floating point number in Python.\n",
    "\n",
    "Throughout this course we will be mainly working with integers or simple float number types.\n",
    "\n",
    "Here is a table of the two main types we will spend most of our time working with some examples:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table>\n",
    "<tr>\n",
    "    <th>Examples</th> \n",
    "    <th>Number \"Type\"</th>\n",
    "</tr>\n",
    "\n",
    "<tr>\n",
    "    <td>1,2,-5,1000</td>\n",
    "    <td>Integers</td> \n",
    "</tr>\n",
    "\n",
    "<tr>\n",
    "    <td>1.2,-0.5,2e2,3E2</td> \n",
    "    <td>Floating-point numbers</td> \n",
    "</tr>\n",
    " </table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " \n",
    " \n",
    "Now let's start with some basic arithmetic."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Basic Arithmetic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Addition\n",
    "2+1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Subtraction\n",
    "2-1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Multiplication\n",
    "2*2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.5"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Division\n",
    "3/2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Floor Division\n",
    "7//4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Whoa! What just happened? Last time I checked, 7 divided by 4 equals 1.75 not 1!**\n",
    "\n",
    "The reason we get this result is because we are using \"*floor*\" division. The // operator (two forward slashes) truncates the decimal without rounding, and returns an integer result."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**So what if we just want the remainder after division?**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Modulo\n",
    "7%4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4 goes into 7 once, with a remainder of 3. The % operator returns the remainder after division."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Arithmetic continued"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Powers\n",
    "2**3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.0"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Can also do roots this way\n",
    "4**0.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "105"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Order of Operations followed in Python\n",
    "2 + 10 * 10 + 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "156"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Can use parentheses to specify orders\n",
    "(2+10) * (10+3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Variable Assignments\n",
    "\n",
    "Now that we've seen how to use numbers in Python as a calculator let's see how we can assign names and create variables.\n",
    "\n",
    "We use a single equals sign to assign labels to variables. Let's see a few examples of how we can do this."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Let's create an object called \"a\" and assign it the number 5\n",
    "a = 5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now if I call *a* in my Python script, Python will treat it as the number 5."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Adding the objects\n",
    "a+a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What happens on reassignment? Will Python let us write it over?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Reassignment\n",
    "a = 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Check\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Yes! Python allows you to write over assigned variable names. We can also use the variables themselves when doing the reassignment. Here is an example of what I mean:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Check\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Use A to redefine A\n",
    "a = a + a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Check \n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The names you use when creating these labels need to follow a few rules:\n",
    "\n",
    "    1. Names can not start with a number.\n",
    "    2. There can be no spaces in the name, use _ instead.\n",
    "    3. Can't use any of these symbols :'\",<>/?|\\()!@#$%^&*~-+\n",
    "    4. It's considered best practice (PEP8) that names are lowercase.\n",
    "    5. Avoid using the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), \n",
    "       or 'I' (uppercase letter eye) as single character variable names.\n",
    "    6. Avoid using words that have special meaning in Python like \"list\" and \"str\"\n",
    "\n",
    "\n",
    "Using variable names can be a very useful way to keep track of different variables in Python. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Use object names to keep better track of what's going on in your code!\n",
    "my_income = 100\n",
    "\n",
    "tax_rate = 0.1\n",
    "\n",
    "my_taxes = my_income*tax_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.0"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show my taxes!\n",
    "my_taxes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "So what have we learned? We learned some of the basics of numbers in Python. We also learned how to do arithmetic and use Python as a basic calculator. We then wrapped it up with learning about Variable Assignment in Python.\n",
    "\n",
    "Up next we'll learn about Strings!"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/01-Variable Assignment.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Variable Assignment\n",
    "\n",
    "## Rules for variable names\n",
    "* names can not start with a number\n",
    "* names can not contain spaces, use _ intead\n",
    "* names can not contain any of these symbols:\n",
    "\n",
    "      :'\",<>/?|\\!@#%^&*~-+\n",
    "       \n",
    "* it's considered best practice ([PEP8](https://www.python.org/dev/peps/pep-0008/#function-and-variable-names)) that names are lowercase with underscores\n",
    "* avoid using Python built-in keywords like `list` and `str`\n",
    "* avoid using the single characters `l` (lowercase letter el), `O` (uppercase letter oh) and `I` (uppercase letter eye) as they can be confused with `1` and `0`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dynamic Typing\n",
    "\n",
    "Python uses *dynamic typing*, meaning you can reassign variables to different data types. This makes Python very flexible in assigning data types; it differs from other languages that are *statically typed*."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_dogs = 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_dogs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_dogs = ['Sammy', 'Frankie']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Sammy', 'Frankie']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_dogs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Pros and Cons of Dynamic Typing\n",
    "#### Pros of Dynamic Typing\n",
    "* very easy to work with\n",
    "* faster development time\n",
    "\n",
    "#### Cons of Dynamic Typing\n",
    "* may result in unexpected bugs!\n",
    "* you need to be aware of `type()`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Assigning Variables\n",
    "Variable assignment follows `name = object`, where a single equals sign `=` is an *assignment operator*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we assigned the integer object `5` to the variable name `a`.<br>Let's assign `a` to something else:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can now use `a` in place of the number `10`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a + a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reassigning Variables\n",
    "Python lets you reassign variables with a reference to the same object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = a + 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There's actually a shortcut for this. Python lets you add, subtract, multiply and divide numbers with reassignment using `+=`, `-=`, `*=`, and `/=`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a += 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a *= 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "60"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Determining variable type with `type()`\n",
    "You can check what type of object is assigned to a variable using Python's built-in `type()` function. Common data types include:\n",
    "* **int** (for integer)\n",
    "* **float**\n",
    "* **str** (for string)\n",
    "* **list**\n",
    "* **tuple**\n",
    "* **dict** (for dictionary)\n",
    "* **set**\n",
    "* **bool** (for Boolean True/False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "int"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = (1,2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tuple"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(a)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Simple Exercise\n",
    "This shows how variables make calculations more readable and easier to follow."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "my_income = 100\n",
    "tax_rate = 0.1\n",
    "my_taxes = my_income * tax_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.0"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_taxes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Great! You should now understand the basics of variable assignment and reassignment in Python.<br>Up next, we'll learn about strings!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}


================================================
FILE: 00-Python Object and Data Structure Basics/02-Strings.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Strings"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Strings are used in Python to record text information, such as names. Strings in Python are actually a *sequence*, which basically means Python keeps track of every element in the string as a sequence. For example, Python understands the string \"hello' to be a sequence of letters in a specific order. This means we will be able to use indexing to grab particular letters (like the first letter, or the last letter).\n",
    "\n",
    "This idea of a sequence is an important one in Python and we will touch upon it later on in the future.\n",
    "\n",
    "In this lecture we'll learn about the following:\n",
    "\n",
    "    1.) Creating Strings\n",
    "    2.) Printing Strings\n",
    "    3.) String Indexing and Slicing\n",
    "    4.) String Properties\n",
    "    5.) String Methods\n",
    "    6.) Print Formatting"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Creating a String\n",
    "To create a string in Python you need to use either single quotes or double quotes. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hello'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Single word\n",
    "'hello'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'This is also a string'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Entire phrase \n",
    "'This is also a string'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'String built with double quotes'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We can also use double quote\n",
    "\"String built with double quotes\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-4-da9a34b3dc31>, line 2)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-4-da9a34b3dc31>\"\u001b[1;36m, line \u001b[1;32m2\u001b[0m\n\u001b[1;33m    ' I'm using single quotes, but this will create an error'\u001b[0m\n\u001b[1;37m        ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "# Be careful with quotes!\n",
    "' I'm using single quotes, but this will create an error'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The reason for the error above is because the single quote in <code>I'm</code> stopped the string. You can use combinations of double and single quotes to get the complete statement."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"Now I'm ready to use the single quotes inside a string!\""
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"Now I'm ready to use the single quotes inside a string!\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now let's learn about printing strings!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Printing a String\n",
    "\n",
    "Using Jupyter notebook with just a string in a cell will automatically output strings, but the correct way to display strings in your output is by using a print function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We can simply declare a string\n",
    "'Hello World'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World 2'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Note that we can't output multiple strings this way\n",
    "'Hello World 1'\n",
    "'Hello World 2'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use a print statement to print a string."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World 1\n",
      "Hello World 2\n",
      "Use \n",
      " to print a new line\n",
      "\n",
      "\n",
      "See what I mean?\n"
     ]
    }
   ],
   "source": [
    "print('Hello World 1')\n",
    "print('Hello World 2')\n",
    "print('Use \\n to print a new line')\n",
    "print('\\n')\n",
    "print('See what I mean?')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## String Basics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use a function called len() to check the length of a string!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "11"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len('Hello World')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Python's built-in len() function counts all of the characters in the string, including spaces and punctuation."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## String Indexing\n",
    "We know strings are a sequence, which means Python can use indexes to call parts of the sequence. Let's learn how this works.\n",
    "\n",
    "In Python, we use brackets <code>[]</code> after an object to call its index. We should also note that indexing starts at 0 for Python. Let's create a new object called <code>s</code> and then walk through a few examples of indexing."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Assign s as a string\n",
    "s = 'Hello World'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Check\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World\n"
     ]
    }
   ],
   "source": [
    "# Print the object\n",
    "print(s) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's start indexing!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'H'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show first element (in this case a letter)\n",
    "s[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'e'"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'l'"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[2]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use a <code>:</code> to perform *slicing* which grabs everything up to a designated point. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ello World'"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything past the first term all the way to the length of s which is len(s)\n",
    "s[1:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Note that there is no change to the original s\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hel'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything UP TO the 3rd index\n",
    "s[:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note the above slicing. Here we're telling Python to grab everything from 0 up to 3. It doesn't include the 3rd index. You'll notice this a lot in Python, where statements and are usually in the context of \"up to, but not including\"."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Everything\n",
    "s[:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use negative indexing to go backwards."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'d'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Last letter (one index behind 0 so it loops back around)\n",
    "s[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello Worl'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything but the last letter\n",
    "s[:-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use index and slice notation to grab elements of a sequence by a specified step size (the default is 1). For instance we can use two colons in a row and then a number specifying the frequency to grab elements. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything, but go in steps size of 1\n",
    "s[::1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'HloWrd'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Grab everything, but go in step sizes of 2\n",
    "s[::2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'dlroW olleH'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We can use this to print a string backwards\n",
    "s[::-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## String Properties\n",
    "It's important to note that strings have an important property known as *immutability*. This means that once a string is created, the elements within it can not be changed or replaced. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'str' object does not support item assignment",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-26-976942677f11>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;31m# Let's try to change the first letter to 'x'\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0ms\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'x'\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: 'str' object does not support item assignment"
     ]
    }
   ],
   "source": [
    "# Let's try to change the first letter to 'x'\n",
    "s[0] = 'x'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice how the error tells us directly what we can't do, change the item assignment!\n",
    "\n",
    "Something we *can* do is concatenate strings!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World concatenate me!'"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Concatenate strings!\n",
    "s + ' concatenate me!'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# We can reassign s completely though!\n",
    "s = s + ' concatenate me!'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello World concatenate me!\n"
     ]
    }
   ],
   "source": [
    "print(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World concatenate me!'"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use the multiplication symbol to create repetition!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "letter = 'z'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'zzzzzzzzzz'"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "letter*10"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Basic Built-in String methods\n",
    "\n",
    "Objects in Python usually have built-in methods. These methods are functions inside the object (we will learn about these in much more depth later) that can perform actions or commands on the object itself.\n",
    "\n",
    "We call methods with a period and then the method name. Methods are in the form:\n",
    "\n",
    "object.method(parameters)\n",
    "\n",
    "Where parameters are extra arguments we can pass into the method. Don't worry if the details don't make 100% sense right now. Later on we will be creating our own objects and functions!\n",
    "\n",
    "Here are some examples of built-in methods in strings:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Hello World concatenate me!'"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'HELLO WORLD CONCATENATE ME!'"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Upper Case a string\n",
    "s.upper()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'hello world concatenate me!'"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Lower case\n",
    "s.lower()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Hello', 'World', 'concatenate', 'me!']"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Split a string by blank space (this is the default)\n",
    "s.split()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Hello ', 'orld concatenate me!']"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Split by a specific element (doesn't include the element that was split on)\n",
    "s.split('W')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are many more methods than the ones covered here. Visit the Advanced String section to find out more!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Print Formatting\n",
    "\n",
    "We can use the .format() method to add formatted objects to printed string statements. \n",
    "\n",
    "The easiest way to show this is through an example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Insert another string with curly brackets: The inserted string'"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'Insert another string with curly brackets: {}'.format('The inserted string')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We will revisit this string formatting topic in later sections when we are building our projects!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Next up: Lists!"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}


================================================
FILE: 00-Python Object and Data Structure Basics/03-Print Formatting with Strings.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "<a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a>\n",
    "___\n",
    "<center><em>Content Copyright by Pierian Data</em></center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# String Formatting\n",
    "\n",
    "String formatting lets you inject items into a string rather than trying to chain items together using commas or string concatenation. As a quick comparison, consider:\n",
    "\n",
    "    player = 'Thomas'\n",
    "    points = 33\n",
    "    \n",
    "    'Last night, '+player+' scored '+str(points)+' points.'  # concatenation\n",
    "    \n",
    "    f'Last night, {player} scored {points} points.'          # string formatting\n",
    "\n",
    "\n",
    "There are three ways to perform string formatting.\n",
    "* The oldest method involves placeholders using the modulo `%` character.\n",
    "* An improved technique uses the `.format()` string method.\n",
    "* The newest method, introduced with Python 3.6, uses formatted string literals, called *f-strings*.\n",
    "\n",
    "Since you will likely encounter all three versions in someone else's code, we describe each of them here."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Formatting with placeholders\n",
    "You can use <code>%s</code> to inject strings into your print statements. The modulo `%` is referred to as a \"string formatting operator\"."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I'm going to inject something here.\n"
     ]
    }
   ],
   "source": [
    "print(\"I'm going to inject %s here.\" %'something')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can pass multiple items by placing them inside a tuple after the `%` operator."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I'm going to inject some text here, and more text here.\n"
     ]
    }
   ],
   "source": [
    "print(\"I'm going to inject %s text here, and %s text here.\" %('some','more'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can also pass variable names:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I'm going to inject some text here, and more text here.\n"
     ]
    }
   ],
   "source": [
    "x, y = 'some', 'more'\n",
    "print(\"I'm going to inject %s text here, and %s text here.\"%(x,y))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Format conversion methods.\n",
    "It should be noted that two methods <code>%s</code> and <code>%r</code> convert any python object to a string using two separate methods: `str()` and `repr()`. We will learn more about these functions later on in the course, but you should note that `%r` and `repr()` deliver the *string representation* of the object, including quotation marks and any escape characters."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "He said his name was Fred.\n",
      "He said his name was 'Fred'.\n"
     ]
    }
   ],
   "source": [
    "print('He said his name was %s.' %'Fred')\n",
    "print('He said his name was %r.' %'Fred')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As another example, `\\t` inserts a tab into a string."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I once caught a fish this \tbig.\n",
      "I once caught a fish 'this \\tbig'.\n"
     ]
    }
   ],
   "source": [
    "print('I once caught a fish %s.' %'this \\tbig')\n",
    "print('I once caught a fish %r.' %'this \\tbig')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `%s` operator converts whatever it sees into a string, including integers and floats. The `%d` operator converts numbers to integers first, without rounding. Note the difference below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I wrote 3.75 programs today.\n",
      "I wrote 3 programs today.\n"
     ]
    }
   ],
   "source": [
    "print('I wrote %s programs today.' %3.75)\n",
    "print('I wrote %d programs today.' %3.75)   "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Padding and Precision of Floating Point Numbers\n",
    "Floating point numbers use the format <code>%5.2f</code>. Here, <code>5</code> would be the minimum number of characters the string should contain; these may be padded with whitespace if the entire number does not have this many digits. Next to this, <code>.2f</code> stands for how many numbers to show past the decimal point. Let's see some examples:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers: 13.14\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %5.2f' %(13.144))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers: 13\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %1.0f' %(13.144))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers: 13.14400\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %1.5f' %(13.144))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers:      13.14\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %10.2f' %(13.144))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Floating point numbers:                     13.14\n"
     ]
    }
   ],
   "source": [
    "print('Floating point numbers: %25.2f' %(13.144))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For more information on string formatting with placeholders visit https://docs.python.org/3/library/stdtypes.html#old-string-formatting"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Multiple Formatting\n",
    "Nothing prohibits using more than one conversion tool in the same print statement:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "First: hi!, Second:  3.14, Third: 'bye!'\n"
     ]
    }
   ],
   "source": [
    "print('First: %s, Second: %5.2f, Third: %r' %('hi!',3.1415,'bye!'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Formatting with the `.format()` method\n",
    "A better way to format objects into your strings for print statements is with the string `.format()` method. The syntax is:\n",
    "\n",
    "    'String here {} then also {}'.format('something1','something2')\n",
    "    \n",
    "For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This is a string with an insert\n"
     ]
    }
   ],
   "source": [
    "print('This is a string with an {}'.format('insert'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### The .format() method has several advantages over the %s placeholder method:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1. Inserted objects can be called by index position:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The quick brown fox\n"
     ]
    }
   ],
   "source": [
    "print('The {2} {1} {0}'.format('fox','brown','quick'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2. Inserted objects can be assigned keywords:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "First Object: 1, Second Object: Two, Third Object: 12.3\n"
     ]
    }
   ],
   "source": [
    "print('First Object: {a}, Second Object: {b}, Third Object: {c}'.format(a=1,b='Two',c=12.3))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3. Inserted objects can be reused, avoiding duplication:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A penny saved is a penny earned.\n",
      "A penny saved is a penny earned.\n"
     ]
    }
   ],
   "source": [
    "print('A %s saved is a %s earned.' %('penny','penny'))\n",
    "# vs.\n",
    "print('A {p} saved is a {p} earned.'.format(p='penny'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Alignment, padding and precision with `.format()`\n",
    "Within the curly braces you can assign field lengths, left/right alignments, rounding parameters and more"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fruit    | Quantity \n",
      "Apples   |       3.0\n",
      "Oranges  |        10\n"
     ]
    }
   ],
   "source": [
    "print('{0:8} | {1:9}'.format('Fruit', 'Quantity'))\n",
    "print('{0:8} | {1:9}'.format('Apples', 3.))\n",
    "print('{0:8} | {1:9}'.format('Oranges', 10))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "By default, `.format()` aligns text to the left, numbers to the right. You can pass an optional `<`,`^`, or `>` to set a left, center or right alignment:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Left     |  Center  |    Right\n",
      "11       |    22    |       33\n"
     ]
    }
   ],
   "source": [
    "print('{0:<8} | {1:^8} | {2:>8}'.format('Left','Center','Right'))\n",
    "print('{0:<8} | {1:^8} | {2:>8}'.format(11,22,33))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can precede the aligment operator with a padding character"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Left==== | -Center- | ...Right\n",
      "11====== | ---22--- | ......33\n"
     ]
    }
   ],
   "source": [
    "print('{0:=<8} | {1:-^8} | {2:.>8}'.format('Left','Center','Right'))\n",
    "print('{0:=<8} | {1:-^8} | {2:.>8}'.format(11,22,33))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Field widths and float precision are handled in a way similar to placeholders. The following two print statements are equivalent:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This is my ten-character, two-decimal number:     13.58\n",
      "This is my ten-character, two-decimal number:     13.58\n"
     ]
    }
   ],
   "source": [
    "print('This is my ten-character, two-decimal number:%10.2f' %13.579)\n",
    "print('This is my ten-character, two-decimal number:{0:10.2f}'.format(13.579))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that there are 5 spaces following the colon, and 5 characters taken up by 13.58, for a total of ten characters.\n",
    "\n",
    "For more information on the string `.format()` method visit https://docs.python.org/3/library/string.html#formatstrings"
   ]
  },
  {
   "cell_type": "markdown",
   "metadat
Download .txt
gitextract_qnczp_qk/

├── .ipynb_checkpoints/
│   └── Untitled-checkpoint.ipynb
├── 00-Python Object and Data Structure Basics/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Numbers-checkpoint.ipynb
│   │   ├── 01-Variable Assignment-checkpoint.ipynb
│   │   ├── 02-Strings-checkpoint.ipynb
│   │   ├── 03-Print Formatting with Strings-checkpoint.ipynb
│   │   ├── 04-Lists-checkpoint.ipynb
│   │   ├── 05-Dictionaries-checkpoint.ipynb
│   │   ├── 06-Tuples-checkpoint.ipynb
│   │   ├── 07-Sets and Booleans-checkpoint.ipynb
│   │   ├── 08-Files-checkpoint.ipynb
│   │   ├── 09-Objects and Data Structures Assessment Test-checkpoint.ipynb
│   │   └── 10-Objects and Data Structures Assessment Test-Solution-checkpoint.ipynb
│   ├── 01-Numbers.ipynb
│   ├── 01-Variable Assignment.ipynb
│   ├── 02-Strings.ipynb
│   ├── 03-Print Formatting with Strings.ipynb
│   ├── 04-Lists.ipynb
│   ├── 05-Dictionaries.ipynb
│   ├── 06-Tuples.ipynb
│   ├── 07-Sets and Booleans.ipynb
│   ├── 08-Files.ipynb
│   ├── 09-Objects and Data Structures Assessment Test.ipynb
│   ├── 10-Objects and Data Structures Assessment Test-Solution.ipynb
│   └── test.txt
├── 01-Python Comparison Operators/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Comparison Operators-checkpoint.ipynb
│   │   └── 02-Chained Comparison Operators-checkpoint.ipynb
│   ├── 01-Comparison Operators.ipynb
│   └── 02-Chained Comparison Operators.ipynb
├── 02-Python Statements/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Introduction to Python Statements-checkpoint.ipynb
│   │   ├── 02-if, elif, and else Statements-checkpoint.ipynb
│   │   ├── 03-for Loops-checkpoint.ipynb
│   │   ├── 04-while Loops-checkpoint.ipynb
│   │   ├── 05-Useful-Operators-checkpoint.ipynb
│   │   ├── 05-range()-checkpoint.ipynb
│   │   ├── 06-List Comprehensions-checkpoint.ipynb
│   │   ├── 07-Statements Assessment Test-checkpoint.ipynb
│   │   ├── 08-Statements Assessment Test - Solutions-checkpoint.ipynb
│   │   ├── 09-Guessing Game Challenge-checkpoint.ipynb
│   │   └── 10-Guessing Game Challenge - Solution-checkpoint.ipynb
│   ├── 01-Introduction to Python Statements.ipynb
│   ├── 02-if, elif, and else Statements.ipynb
│   ├── 03-for Loops.ipynb
│   ├── 04-while Loops.ipynb
│   ├── 05-Useful-Operators.ipynb
│   ├── 06-List Comprehensions.ipynb
│   ├── 07-Statements Assessment Test.ipynb
│   ├── 08-Statements Assessment Test - Solutions.ipynb
│   ├── 09-Guessing Game Challenge.ipynb
│   └── 10-Guessing Game Challenge - Solution.ipynb
├── 03-Methods and Functions/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Methods-checkpoint.ipynb
│   │   ├── 02-Functions-checkpoint.ipynb
│   │   ├── 03-Function Practice Exercises-checkpoint.ipynb
│   │   ├── 03-Lambda expressions-checkpoint.ipynb
│   │   ├── 04-Function Practice Exercises - Solutions-checkpoint.ipynb
│   │   ├── 04-Nested Statements and Scope-checkpoint.ipynb
│   │   ├── 05-Functions and Methods Homework-checkpoint.ipynb
│   │   ├── 05-Lambda-Expressions-Map-and-Filter-checkpoint.ipynb
│   │   ├── 06-Functions and Methods Homework - Solutions-checkpoint.ipynb
│   │   ├── 06-Nested Statements and Scope-checkpoint.ipynb
│   │   ├── 07-args and kwargs-checkpoint.ipynb
│   │   ├── 08-Function Practice Exercises-checkpoint.ipynb
│   │   ├── 08-Functions and Methods Homework-checkpoint.ipynb
│   │   ├── 09-Function Practice Exercises - Solutions-checkpoint.ipynb
│   │   └── 09-Functions and Methods Homework - Solutions-checkpoint.ipynb
│   ├── 01-Methods.ipynb
│   ├── 02-Functions.ipynb
│   ├── 03-Function Practice Exercises.ipynb
│   ├── 04-Function Practice Exercises - Solutions.ipynb
│   ├── 05-Lambda-Expressions-Map-and-Filter.ipynb
│   ├── 06-Nested Statements and Scope.ipynb
│   ├── 07-args and kwargs.ipynb
│   ├── 08-Functions and Methods Homework.ipynb
│   └── 09-Functions and Methods Homework - Solutions.ipynb
├── 04-Milestone Project - 1/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Warm-Up-Project-Exercises-checkpoint.ipynb
│   │   ├── 01-Milestone Project 1 - Assignment-checkpoint.ipynb
│   │   ├── 02-Milestone Project 1 - Walkthrough Steps Workbook-checkpoint.ipynb
│   │   └── 03-Milestone Project 1 - Complete Walkthrough Solution-checkpoint.ipynb
│   ├── 00-Warm-Up-Project-Exercises.ipynb
│   ├── 01-Milestone Project 1 - Assignment.ipynb
│   ├── 02-Milestone Project 1 - Walkthrough Steps Workbook.ipynb
│   └── 03-Milestone Project 1 - Complete Walkthrough Solution.ipynb
├── 05-Object Oriented Programming/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Object Oriented Programming-Copy1-checkpoint.ipynb
│   │   ├── 01-Object Oriented Programming-checkpoint.ipynb
│   │   ├── 02-Object Oriented Programming Homework-checkpoint.ipynb
│   │   ├── 03-Object Oriented Programming Homework - Solution-checkpoint.ipynb
│   │   ├── 04-OOP Challenge-checkpoint.ipynb
│   │   └── 05-OOP Challenge - Solution-checkpoint.ipynb
│   ├── 01-Object Oriented Programming.ipynb
│   ├── 02-Object Oriented Programming Homework.ipynb
│   ├── 03-Object Oriented Programming Homework - Solution.ipynb
│   ├── 04-OOP Challenge.ipynb
│   └── 05-OOP Challenge - Solution.ipynb
├── 06-Modules and Packages/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Modules and Packages-checkpoint.ipynb
│   │   └── Useful_Info_Notebook-checkpoint.ipynb
│   ├── 00-Modules_and_Packages/
│   │   ├── MyMainPackage/
│   │   │   ├── SubPackage/
│   │   │   │   ├── __init__.py
│   │   │   │   └── mysubscript.py
│   │   │   ├── __init__.py
│   │   │   └── some_main_script.py
│   │   ├── mymodule.py
│   │   └── myprogram.py
│   ├── 01-Name_and_Main/
│   │   ├── Explanation.txt
│   │   ├── one.py
│   │   └── two.py
│   └── Useful_Info_Notebook.ipynb
├── 07-Errors and Exception Handling/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Errors and Exceptions Handling-checkpoint.ipynb
│   │   ├── 02-Errors and Exceptions Homework-checkpoint.ipynb
│   │   ├── 03-Errors and Exceptions Homework - Solution-checkpoint.ipynb
│   │   └── 04-Unit Testing-checkpoint.ipynb
│   ├── 01-Errors and Exceptions Handling.ipynb
│   ├── 02-Errors and Exceptions Homework.ipynb
│   ├── 03-Errors and Exceptions Homework - Solution.ipynb
│   ├── 04-Unit Testing.ipynb
│   ├── cap.py
│   ├── simple1.py
│   ├── simple2.py
│   ├── test_cap.py
│   └── testfile
├── 08-Milestone Project - 2/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Milestone-2-Warmup-Project-checkpoint.ipynb
│   │   ├── 01-Milestone Project 2 - Assignment-checkpoint.ipynb
│   │   ├── 02-Milestone Project 2 - Walkthrough Steps Workbook-checkpoint.ipynb
│   │   └── 03-Milestone Project 2 - Complete Walkthrough Solution-checkpoint.ipynb
│   ├── 00-Milestone-2-Warmup-Project.ipynb
│   ├── 01-Milestone Project 2 - Assignment.ipynb
│   ├── 02-Milestone Project 2 - Walkthrough Steps Workbook.ipynb
│   └── 03-Milestone Project 2 - Complete Walkthrough Solution.ipynb
├── 09-Empty-Section-Skip/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Map-checkpoint.ipynb
│   │   ├── 02-Reduce-checkpoint.ipynb
│   │   ├── 03-Filter-checkpoint.ipynb
│   │   ├── 04-Zip-checkpoint.ipynb
│   │   ├── 05-Enumerate-checkpoint.ipynb
│   │   ├── 06-all() and any()-checkpoint.ipynb
│   │   ├── 07-Complex-checkpoint.ipynb
│   │   ├── 08-Built-in Functions Assessment Test-checkpoint.ipynb
│   │   └── 09-Built-in Functions Assessment Test - Solution-checkpoint.ipynb
│   ├── 01-Map.ipynb
│   ├── 02-Reduce.ipynb
│   ├── 03-Filter.ipynb
│   ├── 04-Zip.ipynb
│   ├── 05-Enumerate.ipynb
│   ├── 06-all() and any().ipynb
│   ├── 07-Complex.ipynb
│   ├── 08-Built-in Functions Assessment Test.ipynb
│   └── 09-Built-in Functions Assessment Test - Solution.ipynb
├── 10-Python Decorators/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Decorators-checkpoint.ipynb
│   │   └── 02-Decorators Homework-checkpoint.ipynb
│   ├── 01-Decorators.ipynb
│   └── 02-Decorators Homework.ipynb
├── 11-Python Generators/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Iterators and Generators-checkpoint.ipynb
│   │   ├── 02-Iterators and Generators Homework-checkpoint.ipynb
│   │   └── 03-Iterators and Generators Homework - Solution-checkpoint.ipynb
│   ├── 01-Iterators and Generators.ipynb
│   ├── 02-Iterators and Generators Homework.ipynb
│   └── 03-Iterators and Generators Homework - Solution.ipynb
├── 12-Advanced Python Modules/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Collections-Module-checkpoint.ipynb
│   │   ├── 01-Datetime-Module-checkpoint.ipynb
│   │   ├── 01-Opening-and-Reading-Files-Folders-checkpoint.ipynb
│   │   ├── 02-Datetime-Module-checkpoint.ipynb
│   │   ├── 02-Math-and-Random-Module-checkpoint.ipynb
│   │   ├── 03-Math-and-Random-Module-checkpoint.ipynb
│   │   ├── 03-Python Debugger (pdb)-checkpoint.ipynb
│   │   ├── 04-Python Debugger (pdb)-checkpoint.ipynb
│   │   ├── 04-Timing your code - timeit-checkpoint.ipynb
│   │   ├── 05-Overview-of-Regular-Expressions-checkpoint.ipynb
│   │   ├── 06-Timing your code - timeit-checkpoint.ipynb
│   │   ├── 06-Unzipping-and-Zipping-Files-checkpoint.ipynb
│   │   ├── 07-OS-Module-checkpoint.ipynb
│   │   ├── 07-Unzipping-and-Zipping-Files-checkpoint.ipynb
│   │   └── 09-Advanced-Modules-Exercise-Solutions-checkpoint.ipynb
│   ├── 00-Collections-Module.ipynb
│   ├── 01-Opening-and-Reading-Files-Folders.ipynb
│   ├── 02-Datetime-Module.ipynb
│   ├── 03-Math-and-Random-Module.ipynb
│   ├── 04-Python Debugger (pdb).ipynb
│   ├── 05-Overview-of-Regular-Expressions.ipynb
│   ├── 06-Timing your code - timeit.ipynb
│   ├── 07-Unzipping-and-Zipping-Files.ipynb
│   ├── 08-Advanced-Python-Module-Exercise/
│   │   ├── .ipynb_checkpoints/
│   │   │   ├── 07-Advanced-Modules-Exercise-Puzzle-checkpoint.ipynb
│   │   │   └── 08-Advanced-Modules-Exercise-Solutions-checkpoint.ipynb
│   │   ├── 07-Advanced-Modules-Exercise-Puzzle.ipynb
│   │   ├── 08-Advanced-Modules-Exercise-Solutions.ipynb
│   │   └── extracted_content/
│   │       ├── Five/
│   │       │   ├── AEITMYIRQLP.txt
│   │       │   ├── APJKSRITGGX.txt
│   │       │   ├── AQKATDFGXTS.txt
│   │       │   ├── ARLKFCWIAJE.txt
│   │       │   ├── AXJGVPVEFAS.txt
│   │       │   ├── BNUQEHCFRTG.txt
│   │       │   ├── BSKJDRNEZQM.txt
│   │       │   ├── BTYWAHLHKBM.txt
│   │       │   ├── BUGKBZWRRVI.txt
│   │       │   ├── BVBURZZCAPR.txt
│   │       │   ├── CAHBEVSVDDN.txt
│   │       │   ├── COMGMZBJAYE.txt
│   │       │   ├── CRFSDGYFSHA.txt
│   │       │   ├── CSCLFZCDYYC.txt
│   │       │   ├── CXBVCTRBBIE.txt
│   │       │   ├── DDLASODUVPX.txt
│   │       │   ├── DHZBAAYEADM.txt
│   │       │   ├── DQPZQLBCJYP.txt
│   │       │   ├── DYOPIIVMZOO.txt
│   │       │   ├── DZUWWXYIAEL.txt
│   │       │   ├── EAAOEPSAWMQ.txt
│   │       │   ├── EIPWXMQZJKU.txt
│   │       │   ├── ESIZWBHMGDP.txt
│   │       │   ├── ETCUEXWNBCF.txt
│   │       │   └── EYTCGIOYWIW.txt
│   │       ├── Four/
│   │       │   ├── ECIOBYCDVFI.txt
│   │       │   ├── EMTGPSXQEJX.txt
│   │       │   ├── EPRNUHRSESC.txt
│   │       │   ├── ESDIZXHYCVY.txt
│   │       │   ├── EXVQSVBQQQH.txt
│   │       │   ├── QCTCKDIBBVG.txt
│   │       │   ├── QCWCFLKNZMN.txt
│   │       │   ├── QDDETWBHJYC.txt
│   │       │   ├── QTDYYIFPHAU.txt
│   │       │   ├── QVNJULGXNUM.txt
│   │       │   ├── REAXWSOIQDY.txt
│   │       │   ├── ROICPTWKXDX.txt
│   │       │   ├── RSXOTNGKBML.txt
│   │       │   ├── RXDARIDGKBF.txt
│   │       │   ├── RYNXFYXMKHG.txt
│   │       │   ├── TAKNAVDMZKV.txt
│   │       │   ├── THPNEGKTJWI.txt
│   │       │   ├── TJFMLJODVAD.txt
│   │       │   ├── TKCZSFQNJTX.txt
│   │       │   ├── TWUOYFCCYBQ.txt
│   │       │   ├── WFSKPTXPFCH.txt
│   │       │   ├── WHTOHQUWXIN.txt
│   │       │   ├── WNJISWPEBRS.txt
│   │       │   ├── WXDJDOGZEHN.txt
│   │       │   └── WYDLGSGGXKV.txt
│   │       ├── Instructions.txt
│   │       ├── One/
│   │       │   ├── HDOHZHFSTTK.txt
│   │       │   ├── HFUTPPAXDIS.txt
│   │       │   ├── HMNZTLIFGPD.txt
│   │       │   ├── HRQFTHKVJTL.txt
│   │       │   ├── HVUTZEVMSBW.txt
│   │       │   ├── JDLRVFCXYLU.txt
│   │       │   ├── JEHBLZPUPSP.txt
│   │       │   ├── JLTXKIGCWDL.txt
│   │       │   ├── JQUOBKFUACN.txt
│   │       │   ├── JTHSNBNPQSE.txt
│   │       │   ├── KCXGNQCZBLO.txt
│   │       │   ├── KFIUZFERLET.txt
│   │       │   ├── KMMLGJOWLGI.txt
│   │       │   ├── KNBSKDREHQU.txt
│   │       │   ├── KTXDHIOKAUI.txt
│   │       │   ├── LDGOCUQJNNS.txt
│   │       │   ├── LFEATJAAYDC.txt
│   │       │   ├── LHODFIKVTQA.txt
│   │       │   ├── LIFDHOFKWOI.txt
│   │       │   ├── LPNDVDXPZIG.txt
│   │       │   ├── PDJMSMNKIRM.txt
│   │       │   ├── PHWAVPEKAER.txt
│   │       │   ├── PLYCGPVEAWO.txt
│   │       │   ├── PQNVCVJINAR.txt
│   │       │   └── PTOBBCJYURJ.txt
│   │       ├── Three/
│   │       │   ├── VAQIJTDOFUJ.txt
│   │       │   ├── VCFJCGJFBIH.txt
│   │       │   ├── VSXFSTABZDY.txt
│   │       │   ├── VVHFVZUNLOO.txt
│   │       │   ├── VVKGWLRMHLU.txt
│   │       │   ├── XAJMCPEWFNI.txt
│   │       │   ├── XFHJOTNPEJG.txt
│   │       │   ├── XHZPVUQTXIO.txt
│   │       │   ├── XJCWENFFGHB.txt
│   │       │   ├── XVMPVSVYKFR.txt
│   │       │   ├── YCESZHJDBXH.txt
│   │       │   ├── YDQFMWXOUMW.txt
│   │       │   ├── YQBIUHSUEVW.txt
│   │       │   ├── YQRNCMNFFHW.txt
│   │       │   ├── YYIZGBTQHZP.txt
│   │       │   ├── ZEZKKRBIZEB.txt
│   │       │   ├── ZKQJXAYKPVD.txt
│   │       │   ├── ZOWVXWPOGWP.txt
│   │       │   ├── ZXEZRQXZNPG.txt
│   │       │   └── ZXIBJMPROKW.txt
│   │       └── Two/
│   │           ├── GKQBQRCTNNK.txt
│   │           ├── GMMQQUBMJNR.txt
│   │           ├── GQTJJORZBXY.txt
│   │           ├── GTOTCIWMDBY.txt
│   │           ├── GXYSEPAFRTP.txt
│   │           ├── HARDNJGDRBC.txt
│   │           ├── HEORIXOTANT.txt
│   │           ├── HMUTDOVNYTV.txt
│   │           ├── HMZXPBOPRAE.txt
│   │           ├── HTOHSTYXTCO.txt
│   │           ├── LCJZYDHBFRM.txt
│   │           ├── LSQSTGPIGIY.txt
│   │           ├── LULTNYAQEJG.txt
│   │           ├── LVMBINRBJXL.txt
│   │           ├── LYZEQCVYNEZ.txt
│   │           ├── OHZOUOSFJQC.txt
│   │           ├── OIHMLGMWTHL.txt
│   │           ├── OKWFOOYTXFU.txt
│   │           ├── OMWIMVRCMYM.txt
│   │           ├── OYMAGXAGWHJ.txt
│   │           ├── SIKFPPLCJDN.txt
│   │           ├── SJMJLDGPBSJ.txt
│   │           ├── SOFUJYXTIMK.txt
│   │           ├── SPDZYGDHEWO.txt
│   │           └── SWOFXREEHWA.txt
│   └── Example_Top_Level/
│       ├── Mid-Example-One/
│       │   ├── Bottom-Level-One/
│       │   │   └── One_Text.txt
│       │   ├── Bottom-Level-Two/
│       │   │   └── Bottom-Text-Two.txt
│       │   └── Mid-Level-Doc.txt
│       └── Mid-Example.txt
├── 13-Web-Scraping/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Guide-to-Web-Scraping-checkpoint.ipynb
│   │   ├── 01-Web-Scraping-Exercises-checkpoint.ipynb
│   │   └── 02-Web-Scraping-Exercise-Solutions-checkpoint.ipynb
│   ├── 00-Guide-to-Web-Scraping.ipynb
│   ├── 01-Web-Scraping-Exercises.ipynb
│   └── 02-Web-Scraping-Exercise-Solutions.ipynb
├── 14-Working-with-Images/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Overview-of-Working-with-Images-checkpoint.ipynb
│   │   ├── 01-Image-Exercise-checkpoint.ipynb
│   │   └── 02-Image-Exercise-Solution-checkpoint.ipynb
│   ├── 00-Overview-of-Working-with-Images.ipynb
│   ├── 01-Image-Exercise.ipynb
│   └── 02-Image-Exercise-Solution.ipynb
├── 15-PDFs-and-Spreadsheets/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Working-with-CSV-Files-checkpoint.ipynb
│   │   ├── 01-Working-with-PDFs-checkpoint.ipynb
│   │   ├── 02-PDFs-Spreadsheets-Puzzle-checkpoint.ipynb
│   │   └── 03-PDFs-Spreadsheets-Puzzle-Solution-checkpoint.ipynb
│   ├── 00-Working-with-CSV-Files.ipynb
│   ├── 01-Working-with-PDFs.ipynb
│   ├── 02-PDFs-Spreadsheets-Puzzle.ipynb
│   ├── 03-PDFs-Spreadsheets-Puzzle-Solution.ipynb
│   ├── Exercise_Files/
│   │   └── find_the_link.csv
│   ├── example.csv
│   ├── makeup_new.csv
│   └── to_save_file.csv
├── 16-Emailing-with-Python/
│   ├── .ipynb_checkpoints/
│   │   ├── 00-Overview-of-Sending-Emails-checkpoint.ipynb
│   │   ├── 01-Overview-of-Received-Emails-checkpoint.ipynb
│   │   └── 02-Exercise-Ideas-checkpoint.ipynb
│   ├── 00-Overview-of-Sending-Emails.ipynb
│   ├── 01-Overview-of-Received-Emails.ipynb
│   └── 02-Exercise-Ideas.ipynb
├── 17-Advanced Python Objects and Data Structures/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Advanced Numbers-checkpoint.ipynb
│   │   ├── 02-Advanced Strings-checkpoint.ipynb
│   │   ├── 03-Advanced Sets-checkpoint.ipynb
│   │   ├── 04-Advanced Dictionaries-checkpoint.ipynb
│   │   ├── 05-Advanced Lists-checkpoint.ipynb
│   │   ├── 06-Advanced Python Objects Test-checkpoint.ipynb
│   │   └── 07-Advanced Python Objects Test - Solutions-checkpoint.ipynb
│   ├── 01-Advanced Numbers.ipynb
│   ├── 02-Advanced Strings.ipynb
│   ├── 03-Advanced Sets.ipynb
│   ├── 04-Advanced Dictionaries.ipynb
│   ├── 05-Advanced Lists.ipynb
│   ├── 06-Advanced Python Objects Test.ipynb
│   ├── 07-Advanced Python Objects Test - Solutions.ipynb
│   └── 08-BONUS - With Statement Context Managers.ipynb
├── 18-Milestone Project - 3/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Final Capstone Project-checkpoint.ipynb
│   │   └── 02-Final Capstone Project Ideas-checkpoint.ipynb
│   ├── 01-Final Capstone Project.ipynb
│   ├── 02-Final Capstone Project Ideas.ipynb
│   └── Projects-Solutions/
│       └── Solution Links.md
├── 19-Bonus Material - Introduction to GUIs/
│   ├── .ipynb_checkpoints/
│   │   ├── 01-Interact-checkpoint.ipynb
│   │   ├── 02-Widget Basics-checkpoint.ipynb
│   │   ├── 03-Widget List-checkpoint.ipynb
│   │   ├── 04-Widget Events-checkpoint.ipynb
│   │   ├── 05-Widget Styling-checkpoint.ipynb
│   │   ├── 06-Custom Widget-checkpoint.ipynb
│   │   ├── 07-Advanced Widget List-checkpoint.ipynb
│   │   └── 08-Advanced Widget Styling with Layout-checkpoint.ipynb
│   ├── 01-Interact.ipynb
│   ├── 02-Widget Basics.ipynb
│   ├── 03-Widget List.ipynb
│   ├── 04-Widget Events.ipynb
│   ├── 05-Widget Styling.ipynb
│   ├── 06-Custom Widget.ipynb
│   ├── 07-Advanced Widget List.ipynb
│   └── 08-Advanced Widget Styling with Layout.ipynb
├── Jupyter (iPython) Notebooks Guide.ipynb
└── README.md
Download .txt
SYMBOL INDEX (11 symbols across 8 files)

FILE: 06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/mysubscript.py
  function sub_report (line 1) | def sub_report():

FILE: 06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/some_main_script.py
  function report_main (line 1) | def report_main():

FILE: 06-Modules and Packages/00-Modules_and_Packages/mymodule.py
  function my_func (line 1) | def my_func():

FILE: 06-Modules and Packages/01-Name_and_Main/one.py
  function func (line 1) | def func():

FILE: 07-Errors and Exception Handling/cap.py
  function cap_text (line 1) | def cap_text(text):

FILE: 07-Errors and Exception Handling/simple1.py
  function myfunc (line 5) | def myfunc():

FILE: 07-Errors and Exception Handling/simple2.py
  function myfunc (line 5) | def myfunc():

FILE: 07-Errors and Exception Handling/test_cap.py
  class TestCap (line 4) | class TestCap(unittest.TestCase):
    method test_one_word (line 6) | def test_one_word(self):
    method test_multiple_words (line 11) | def test_multiple_words(self):
    method test_with_apostrophes (line 16) | def test_with_apostrophes(self):
Condensed preview — 373 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,707K chars).
[
  {
    "path": ".ipynb_checkpoints/Untitled-checkpoint.ipynb",
    "chars": 72,
    "preview": "{\n \"cells\": [],\n \"metadata\": {},\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/01-Numbers-checkpoint.ipynb",
    "chars": 11464,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/01-Variable Assignment-checkpoint.ipynb",
    "chars": 8779,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/02-Strings-checkpoint.ipynb",
    "chars": 21316,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/03-Print Formatting with Strings-checkpoint.ipynb",
    "chars": 17491,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/04-Lists-checkpoint.ipynb",
    "chars": 16402,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/05-Dictionaries-checkpoint.ipynb",
    "chars": 9907,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/06-Tuples-checkpoint.ipynb",
    "chars": 7057,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/07-Sets and Booleans-checkpoint.ipynb",
    "chars": 6259,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/08-Files-checkpoint.ipynb",
    "chars": 13558,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/09-Objects and Data Structures Assessment Test-checkpoint.ipynb",
    "chars": 11658,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/.ipynb_checkpoints/10-Objects and Data Structures Assessment Test-Solution-checkpoint.ipynb",
    "chars": 18166,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/01-Numbers.ipynb",
    "chars": 11464,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/01-Variable Assignment.ipynb",
    "chars": 8779,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/02-Strings.ipynb",
    "chars": 21316,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/03-Print Formatting with Strings.ipynb",
    "chars": 17491,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/04-Lists.ipynb",
    "chars": 16402,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/05-Dictionaries.ipynb",
    "chars": 9907,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/06-Tuples.ipynb",
    "chars": 7057,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/07-Sets and Booleans.ipynb",
    "chars": 6259,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/08-Files.ipynb",
    "chars": 13558,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/09-Objects and Data Structures Assessment Test.ipynb",
    "chars": 11658,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/10-Objects and Data Structures Assessment Test-Solution.ipynb",
    "chars": 18166,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "00-Python Object and Data Structure Basics/test.txt",
    "chars": 22,
    "preview": "First Line\nSecond Line"
  },
  {
    "path": "01-Python Comparison Operators/.ipynb_checkpoints/01-Comparison Operators-checkpoint.ipynb",
    "chars": 7516,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "01-Python Comparison Operators/.ipynb_checkpoints/02-Chained Comparison Operators-checkpoint.ipynb",
    "chars": 4530,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "01-Python Comparison Operators/01-Comparison Operators.ipynb",
    "chars": 7516,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "01-Python Comparison Operators/02-Chained Comparison Operators.ipynb",
    "chars": 4530,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/01-Introduction to Python Statements-checkpoint.ipynb",
    "chars": 3984,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/02-if, elif, and else Statements-checkpoint.ipynb",
    "chars": 5454,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/03-for Loops-checkpoint.ipynb",
    "chars": 13824,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/04-while Loops-checkpoint.ipynb",
    "chars": 9139,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/05-Useful-Operators-checkpoint.ipynb",
    "chars": 13380,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/05-range()-checkpoint.ipynb",
    "chars": 3657,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# range()\\n\",\n    \"\\n\",\n    \"In thi"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/06-List Comprehensions-checkpoint.ipynb",
    "chars": 4821,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/07-Statements Assessment Test-checkpoint.ipynb",
    "chars": 3958,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/08-Statements Assessment Test - Solutions-checkpoint.ipynb",
    "chars": 5467,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/09-Guessing Game Challenge-checkpoint.ipynb",
    "chars": 4538,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/.ipynb_checkpoints/10-Guessing Game Challenge - Solution-checkpoint.ipynb",
    "chars": 8283,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/01-Introduction to Python Statements.ipynb",
    "chars": 3984,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/02-if, elif, and else Statements.ipynb",
    "chars": 5454,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/03-for Loops.ipynb",
    "chars": 13824,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/04-while Loops.ipynb",
    "chars": 9139,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/05-Useful-Operators.ipynb",
    "chars": 13380,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/06-List Comprehensions.ipynb",
    "chars": 4821,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/07-Statements Assessment Test.ipynb",
    "chars": 3958,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/08-Statements Assessment Test - Solutions.ipynb",
    "chars": 5467,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/09-Guessing Game Challenge.ipynb",
    "chars": 4538,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "02-Python Statements/10-Guessing Game Challenge - Solution.ipynb",
    "chars": 8283,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/01-Methods-checkpoint.ipynb",
    "chars": 4717,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/02-Functions-checkpoint.ipynb",
    "chars": 29865,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/03-Function Practice Exercises-checkpoint.ipynb",
    "chars": 14913,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/03-Lambda expressions-checkpoint.ipynb",
    "chars": 7917,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# lambda expressions\\n\",\n    \"\\n\",\n"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/04-Function Practice Exercises - Solutions-checkpoint.ipynb",
    "chars": 23034,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/04-Nested Statements and Scope-checkpoint.ipynb",
    "chars": 10252,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Nested Statements and Scope \\n\",\n"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/05-Functions and Methods Homework-checkpoint.ipynb",
    "chars": 7558,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Functions and Methods Homework \\n"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/05-Lambda-Expressions-Map-and-Filter-checkpoint.ipynb",
    "chars": 12240,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/06-Functions and Methods Homework - Solutions-checkpoint.ipynb",
    "chars": 8772,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Functions and Methods Homework So"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/06-Nested Statements and Scope-checkpoint.ipynb",
    "chars": 10584,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/07-args and kwargs-checkpoint.ipynb",
    "chars": 7190,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/08-Function Practice Exercises-checkpoint.ipynb",
    "chars": 12681,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Function Practice Exercises\\n\",\n "
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/08-Functions and Methods Homework-checkpoint.ipynb",
    "chars": 8670,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/09-Function Practice Exercises - Solutions-checkpoint.ipynb",
    "chars": 20836,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Function Practice Exercises - Sol"
  },
  {
    "path": "03-Methods and Functions/.ipynb_checkpoints/09-Functions and Methods Homework - Solutions-checkpoint.ipynb",
    "chars": 10358,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/01-Methods.ipynb",
    "chars": 4717,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/02-Functions.ipynb",
    "chars": 29865,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/03-Function Practice Exercises.ipynb",
    "chars": 14913,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/04-Function Practice Exercises - Solutions.ipynb",
    "chars": 23034,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/05-Lambda-Expressions-Map-and-Filter.ipynb",
    "chars": 12240,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/06-Nested Statements and Scope.ipynb",
    "chars": 10584,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/07-args and kwargs.ipynb",
    "chars": 7190,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/08-Functions and Methods Homework.ipynb",
    "chars": 8670,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "03-Methods and Functions/09-Functions and Methods Homework - Solutions.ipynb",
    "chars": 10358,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "04-Milestone Project - 1/.ipynb_checkpoints/00-Warm-Up-Project-Exercises-checkpoint.ipynb",
    "chars": 24061,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "04-Milestone Project - 1/.ipynb_checkpoints/01-Milestone Project 1 - Assignment-checkpoint.ipynb",
    "chars": 2798,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "04-Milestone Project - 1/.ipynb_checkpoints/02-Milestone Project 1 - Walkthrough Steps Workbook-checkpoint.ipynb",
    "chars": 8248,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "04-Milestone Project - 1/.ipynb_checkpoints/03-Milestone Project 1 - Complete Walkthrough Solution-checkpoint.ipynb",
    "chars": 12798,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "04-Milestone Project - 1/00-Warm-Up-Project-Exercises.ipynb",
    "chars": 24061,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "04-Milestone Project - 1/01-Milestone Project 1 - Assignment.ipynb",
    "chars": 2834,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "04-Milestone Project - 1/02-Milestone Project 1 - Walkthrough Steps Workbook.ipynb",
    "chars": 8248,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "04-Milestone Project - 1/03-Milestone Project 1 - Complete Walkthrough Solution.ipynb",
    "chars": 12798,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/.ipynb_checkpoints/01-Object Oriented Programming-Copy1-checkpoint.ipynb",
    "chars": 21028,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {\n    \"collapsed\": true\n   },\n   \"source\": [\n    \"# Object "
  },
  {
    "path": "05-Object Oriented Programming/.ipynb_checkpoints/01-Object Oriented Programming-checkpoint.ipynb",
    "chars": 21649,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/.ipynb_checkpoints/02-Object Oriented Programming Homework-checkpoint.ipynb",
    "chars": 3713,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/.ipynb_checkpoints/03-Object Oriented Programming Homework - Solution-checkpoint.ipynb",
    "chars": 4086,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/.ipynb_checkpoints/04-OOP Challenge-checkpoint.ipynb",
    "chars": 3706,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/.ipynb_checkpoints/05-OOP Challenge - Solution-checkpoint.ipynb",
    "chars": 4376,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/01-Object Oriented Programming.ipynb",
    "chars": 21739,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/02-Object Oriented Programming Homework.ipynb",
    "chars": 3713,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/03-Object Oriented Programming Homework - Solution.ipynb",
    "chars": 4086,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/04-OOP Challenge.ipynb",
    "chars": 3706,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "05-Object Oriented Programming/05-OOP Challenge - Solution.ipynb",
    "chars": 4376,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "06-Modules and Packages/.ipynb_checkpoints/01-Modules and Packages-checkpoint.ipynb",
    "chars": 6359,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Modules and Packages\\n\",\n    \"\\n\""
  },
  {
    "path": "06-Modules and Packages/.ipynb_checkpoints/Useful_Info_Notebook-checkpoint.ipynb",
    "chars": 6691,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/SubPackage/mysubscript.py",
    "chars": 64,
    "preview": "def sub_report():\n\tprint(\"Hey Im a function inside mysubscript\")"
  },
  {
    "path": "06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "06-Modules and Packages/00-Modules_and_Packages/MyMainPackage/some_main_script.py",
    "chars": 74,
    "preview": "def report_main():\n\tprint(\"Hey I am in some_main_script in main package.\")"
  },
  {
    "path": "06-Modules and Packages/00-Modules_and_Packages/mymodule.py",
    "chars": 48,
    "preview": "def my_func():\n\tprint(\"Hey I am in mymodule.py\")"
  },
  {
    "path": "06-Modules and Packages/00-Modules_and_Packages/myprogram.py",
    "chars": 145,
    "preview": "from MyMainPackage.some_main_script import report_main\nfrom MyMainPackage.SubPackage import mysubscript\n\nreport_main()\n\n"
  },
  {
    "path": "06-Modules and Packages/01-Name_and_Main/Explanation.txt",
    "chars": 2221,
    "preview": "Sometimes when you are importing from a module, you would like to know whether\na modules function is being used as an im"
  },
  {
    "path": "06-Modules and Packages/01-Name_and_Main/one.py",
    "chars": 223,
    "preview": "def func():\n    print(\"func() ran in one.py\")\n\nprint(\"top-level print inside of one.py\")\n\nif __name__ == \"__main__\":\n   "
  },
  {
    "path": "06-Modules and Packages/01-Name_and_Main/two.py",
    "chars": 187,
    "preview": "import one\n\nprint(\"top-level in two.py\")\n\none.func()\n\nif __name__ == \"__main__\":\n    print(\"two.py is being run directly"
  },
  {
    "path": "06-Modules and Packages/Useful_Info_Notebook.ipynb",
    "chars": 6691,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/.ipynb_checkpoints/01-Errors and Exceptions Handling-checkpoint.ipynb",
    "chars": 17183,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/.ipynb_checkpoints/02-Errors and Exceptions Homework-checkpoint.ipynb",
    "chars": 4624,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/.ipynb_checkpoints/03-Errors and Exceptions Homework - Solution-checkpoint.ipynb",
    "chars": 3483,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/.ipynb_checkpoints/04-Unit Testing-checkpoint.ipynb",
    "chars": 15415,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/01-Errors and Exceptions Handling.ipynb",
    "chars": 17183,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/02-Errors and Exceptions Homework.ipynb",
    "chars": 4624,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/03-Errors and Exceptions Homework - Solution.ipynb",
    "chars": 3483,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/04-Unit Testing.ipynb",
    "chars": 25314,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "07-Errors and Exception Handling/cap.py",
    "chars": 82,
    "preview": "def cap_text(text):\n    return text.title()  # replace .capitalize() with .title()"
  },
  {
    "path": "07-Errors and Exception Handling/simple1.py",
    "chars": 168,
    "preview": "\"\"\"\nA very simple script.\n\"\"\"\n\ndef myfunc():\n    \"\"\"\n    An extremely simple function.\n    \"\"\"\n    first = 1\n    second "
  },
  {
    "path": "07-Errors and Exception Handling/simple2.py",
    "chars": 170,
    "preview": "\"\"\"\nA very simple script.\n\"\"\"\n\ndef myfunc():\n    \"\"\"\n    An extremely simple function.\n    \"\"\"\n    first = 1\n    second "
  },
  {
    "path": "07-Errors and Exception Handling/test_cap.py",
    "chars": 606,
    "preview": "import unittest\nimport cap\n\nclass TestCap(unittest.TestCase):\n    \n    def test_one_word(self):\n        text = 'python'\n"
  },
  {
    "path": "07-Errors and Exception Handling/testfile",
    "chars": 20,
    "preview": "Test write statement"
  },
  {
    "path": "08-Milestone Project - 2/.ipynb_checkpoints/00-Milestone-2-Warmup-Project-checkpoint.ipynb",
    "chars": 32813,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "08-Milestone Project - 2/.ipynb_checkpoints/01-Milestone Project 2 - Assignment-checkpoint.ipynb",
    "chars": 1946,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "08-Milestone Project - 2/.ipynb_checkpoints/02-Milestone Project 2 - Walkthrough Steps Workbook-checkpoint.ipynb",
    "chars": 14263,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "08-Milestone Project - 2/.ipynb_checkpoints/03-Milestone Project 2 - Complete Walkthrough Solution-checkpoint.ipynb",
    "chars": 28318,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "08-Milestone Project - 2/00-Milestone-2-Warmup-Project.ipynb",
    "chars": 32813,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "08-Milestone Project - 2/01-Milestone Project 2 - Assignment.ipynb",
    "chars": 1946,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "08-Milestone Project - 2/02-Milestone Project 2 - Walkthrough Steps Workbook.ipynb",
    "chars": 14263,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "08-Milestone Project - 2/03-Milestone Project 2 - Complete Walkthrough Solution.ipynb",
    "chars": 28318,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/01-Map-checkpoint.ipynb",
    "chars": 5033,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/02-Reduce-checkpoint.ipynb",
    "chars": 26272,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/03-Filter-checkpoint.ipynb",
    "chars": 3351,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/04-Zip-checkpoint.ipynb",
    "chars": 5380,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/05-Enumerate-checkpoint.ipynb",
    "chars": 3069,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/06-all() and any()-checkpoint.ipynb",
    "chars": 3065,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/07-Complex-checkpoint.ipynb",
    "chars": 2857,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/08-Built-in Functions Assessment Test-checkpoint.ipynb",
    "chars": 6191,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/.ipynb_checkpoints/09-Built-in Functions Assessment Test - Solution-checkpoint.ipynb",
    "chars": 6501,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/01-Map.ipynb",
    "chars": 5033,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/02-Reduce.ipynb",
    "chars": 26272,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/03-Filter.ipynb",
    "chars": 3351,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/04-Zip.ipynb",
    "chars": 5380,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/05-Enumerate.ipynb",
    "chars": 3069,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/06-all() and any().ipynb",
    "chars": 3065,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/07-Complex.ipynb",
    "chars": 2857,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/08-Built-in Functions Assessment Test.ipynb",
    "chars": 6191,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "09-Empty-Section-Skip/09-Built-in Functions Assessment Test - Solution.ipynb",
    "chars": 6501,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "10-Python Decorators/.ipynb_checkpoints/01-Decorators-checkpoint.ipynb",
    "chars": 16430,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "10-Python Decorators/.ipynb_checkpoints/02-Decorators Homework-checkpoint.ipynb",
    "chars": 2325,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "10-Python Decorators/01-Decorators.ipynb",
    "chars": 16430,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "10-Python Decorators/02-Decorators Homework.ipynb",
    "chars": 2450,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "11-Python Generators/.ipynb_checkpoints/01-Iterators and Generators-checkpoint.ipynb",
    "chars": 11672,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "11-Python Generators/.ipynb_checkpoints/02-Iterators and Generators Homework-checkpoint.ipynb",
    "chars": 4241,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "11-Python Generators/.ipynb_checkpoints/03-Iterators and Generators Homework - Solution-checkpoint.ipynb",
    "chars": 4580,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "11-Python Generators/01-Iterators and Generators.ipynb",
    "chars": 11672,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "11-Python Generators/02-Iterators and Generators Homework.ipynb",
    "chars": 4241,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "11-Python Generators/03-Iterators and Generators Homework - Solution.ipynb",
    "chars": 4580,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/00-Collections-Module-checkpoint.ipynb",
    "chars": 11513,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/01-Datetime-Module-checkpoint.ipynb",
    "chars": 6689,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# datetime module\\n\",\n    \"\\n\",\n   "
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/01-Opening-and-Reading-Files-Folders-checkpoint.ipynb",
    "chars": 15990,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/02-Datetime-Module-checkpoint.ipynb",
    "chars": 6969,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/02-Math-and-Random-Module-checkpoint.ipynb",
    "chars": 27124,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Math and Random Modules\\n\",\n    \""
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/03-Math-and-Random-Module-checkpoint.ipynb",
    "chars": 27404,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/03-Python Debugger (pdb)-checkpoint.ipynb",
    "chars": 8217,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Python Debugger\\n\",\n    \"\\n\",\n   "
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/04-Python Debugger (pdb)-checkpoint.ipynb",
    "chars": 8497,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/04-Timing your code - timeit-checkpoint.ipynb",
    "chars": 8799,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Timing your code\\n\",\n    \"Sometim"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/05-Overview-of-Regular-Expressions-checkpoint.ipynb",
    "chars": 27610,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/06-Timing your code - timeit-checkpoint.ipynb",
    "chars": 9131,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/06-Unzipping-and-Zipping-Files-checkpoint.ipynb",
    "chars": 6149,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Unzipping and Zipping Files\\n\",\n "
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/07-OS-Module-checkpoint.ipynb",
    "chars": 14899,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# OS Module\\n\",\n    \"\\n\",\n    \"## O"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/07-Unzipping-and-Zipping-Files-checkpoint.ipynb",
    "chars": 6429,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/.ipynb_checkpoints/09-Advanced-Modules-Exercise-Solutions-checkpoint.ipynb",
    "chars": 5618,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Advanced Modules Exercise Solutio"
  },
  {
    "path": "12-Advanced Python Modules/00-Collections-Module.ipynb",
    "chars": 11513,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/01-Opening-and-Reading-Files-Folders.ipynb",
    "chars": 15990,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/02-Datetime-Module.ipynb",
    "chars": 6969,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/03-Math-and-Random-Module.ipynb",
    "chars": 27404,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/04-Python Debugger (pdb).ipynb",
    "chars": 8497,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/05-Overview-of-Regular-Expressions.ipynb",
    "chars": 27610,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/06-Timing your code - timeit.ipynb",
    "chars": 9131,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/07-Unzipping-and-Zipping-Files.ipynb",
    "chars": 7201,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/.ipynb_checkpoints/07-Advanced-Modules-Exercise-Puzzle-checkpoint.ipynb",
    "chars": 1631,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/.ipynb_checkpoints/08-Advanced-Modules-Exercise-Solutions-checkpoint.ipynb",
    "chars": 6750,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/07-Advanced-Modules-Exercise-Puzzle.ipynb",
    "chars": 1631,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/08-Advanced-Modules-Exercise-Solutions.ipynb",
    "chars": 7320,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"___\\n\",\n    \"\\n\",\n    \"<a href='htt"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/AEITMYIRQLP.txt",
    "chars": 3666,
    "preview": "Eget potenti dictumstvivamus ullamcorper.Veniam nunc condimentum, dapibusnam zzril lacus sanctus venenatis mollis no nib"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/APJKSRITGGX.txt",
    "chars": 3562,
    "preview": "Tortor potenti imperdiet liber per aliquet, maurisaenean eos aaenean blandit turpis at quisque qui.Quis ipsuminteger mal"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/AQKATDFGXTS.txt",
    "chars": 3603,
    "preview": "Dapibus fames tristique aenean autem vitae, aptent cubilia veniam accumsan purusvestibulum morbi.Ut magnis ornare netus "
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/ARLKFCWIAJE.txt",
    "chars": 3641,
    "preview": "Eget elit convallis commodo tristique lectusnullam morbi, facilisisproin et faucibusvestibulum imperdiet nequeetiam.Odio"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/AXJGVPVEFAS.txt",
    "chars": 3940,
    "preview": "Vitae bibendumin montes iriure massa, tortorvestibulum praesent amet diam felissed dictumst blandit nulla.Quis bibendum "
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/BNUQEHCFRTG.txt",
    "chars": 3533,
    "preview": "Cubilia nullasuspendisse luctus vestibulum, esse vivamus nisised.Eratproin ac possim quammaecenas, a nequeetiam nam comm"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/BSKJDRNEZQM.txt",
    "chars": 3908,
    "preview": "Congue tempus rutrum.Ante metusdonec vitae sanctus commodo.Bibendum nam nobis tristique metus consetetur laoreet clita, "
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/BTYWAHLHKBM.txt",
    "chars": 3359,
    "preview": "Elitvivamus lacinia.Feliscras sagittis justocras massa aptent, vivamus viverra pulvinarvestibulum nostra faucibus mi sod"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/BUGKBZWRRVI.txt",
    "chars": 3587,
    "preview": "Lacusnulla ante, inceptos erat varius placerat muspellentesque amet sem.Felis autem torquent elitnunc auctormauris muspe"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/BVBURZZCAPR.txt",
    "chars": 3253,
    "preview": "Lectusnullam massapellentesque sem dictumstvivamus sempermorbi, gubergren aliquyam rhoncusmaecenas nascetur nullam senec"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/CAHBEVSVDDN.txt",
    "chars": 3687,
    "preview": "Consetetur ipsuminteger dolores gubergren morbi.Elitnunc penatibus tortor vulputate bibendumfusce, ametduis cum potenti "
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/COMGMZBJAYE.txt",
    "chars": 3884,
    "preview": "Vitae ultrices luctus mi dignissim.Dictumst magnis.Erat tincidunt.Proin venenatis risus massaphasellus, sanctus bibendum"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/CRFSDGYFSHA.txt",
    "chars": 3787,
    "preview": "Pellentesque leo ut dictumst, fermentum litora velit vulputate dictum gravida ultriciespellentesque.Nullam nonumy.Rebum "
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/CSCLFZCDYYC.txt",
    "chars": 3769,
    "preview": "Tristique nonummy takimata, nonumy ad temporsuspendisse amet rhoncus.Voluptua tortor ac eirmod ultrices liber facilisina"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/CXBVCTRBBIE.txt",
    "chars": 3996,
    "preview": "Temporsuspendisse proin.Suspendisse nostra ultricies doming, scelerisque sadipscing lobortis enimnulla taciti mauris jus"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/DDLASODUVPX.txt",
    "chars": 3819,
    "preview": "A leopraesent malesuadanullam felis metus fusce, nascetur eleifend sagittis rutrum lobortisetiam eget velit.Elitr sapien"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/DHZBAAYEADM.txt",
    "chars": 3668,
    "preview": "A montes potenti zzril, enim leopraesent pulvinarvestibulum.Urnapraesent ridiculus kasd purusvestibulum, dictumst tempor"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/DQPZQLBCJYP.txt",
    "chars": 3098,
    "preview": "Sociosqu pulvinarvestibulum metusdonec ornare scelerisque mauris nibh, sea taciti consequat stet faucibusvestibulum.Elit"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/DYOPIIVMZOO.txt",
    "chars": 3514,
    "preview": "Enimaliquam nonummy id malesuada.Ipsuminteger cum a delenit quisaenean.Labore integer ea mi, primis neque quammaecenas c"
  },
  {
    "path": "12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/extracted_content/Five/DZUWWXYIAEL.txt",
    "chars": 3661,
    "preview": "Semvestibulum bibendum sociis morbi netus elitnunc, ametduis at magna nisi temporsuspendisse imperdietaliquam augue.Nibh"
  }
]

// ... and 173 more files (download for full content)

About this extraction

This page contains the full source code of the Pierian-Data/Complete-Python-3-Bootcamp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 373 files (39.0 MB), approximately 1.1M tokens, and a symbol index with 11 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!