Please enable JavaScript to use CodeHS

Python Programming 2 - Outline

  1. Functions and Exceptions

    1. 1.1 Functions

    2. Video 1.1.1 Functions
    3. Check for Understanding 1.1.2 Functions
    4. Example 1.1.3 Greeting
    5. Example 1.1.4 Extended Greeting
    6. Exercise 1.1.5 Weather
    7. 1.2 Functions and Parameters

    8. Video 1.2.1 Functions and Parameters
    9. Check for Understanding 1.2.2 Functions and Parameters
    10. Example 1.2.3 Print a Value
    11. Example 1.2.4 Name and Age
    12. Exercise 1.2.5 Print Product
    13. Exercise 1.2.6 Print Multiple Times
    14. Example 1.2.7 Default Parameter Values
    15. Exercise 1.2.8 Area of a Square with Default Parameters
    16. 1.3 Namespaces in Functions

    17. Video 1.3.1 Namespaces in Functions
    18. Check for Understanding 1.3.2 Namespaces in Functions
    19. Example 1.3.3 Functions and Variables
    20. Example 1.3.4 Functions and Variables, Part 2
    21. Debugging 1.3.5 Fix This Program!
    22. Exercise 1.3.6 Adding to a Value
    23. Exercise 1.3.7 Add, Subtract, or Multiply
    24. 1.4 Functions and Return Values

    25. Video 1.4.1 Functions and Return Values
    26. Check for Understanding 1.4.2 Functions and Return Values
    27. Example 1.4.3 Return 10
    28. Exercise 1.4.4 Add One
    29. Example 1.4.5 Negate
    30. Example 1.4.6 Functions Calling Functions
    31. Example 1.4.7 Function Calls As Parameters
    32. Exercise 1.4.8 Sum Two Numbers
    33. Exercise 1.4.9 Temperature Converter
    34. Badge 1.4.10 Functions Badge
    35. 1.5 Exceptions

    36. Video 1.5.1 Exceptions
    37. Check for Understanding 1.5.2 Exceptions
    38. Example 1.5.3 Enter a Number
    39. Example 1.5.4 Enter Name and Age
    40. Exercise 1.5.5 Temperature Converter, Part 2
    41. Exercise 1.5.6 Enter a Positive Number
    42. 1.6 Functions & Exceptions Quiz

    43. Unit Quiz 1.6.1 Functions and Exceptions Quiz
    44. Badge 1.6.2 Control Flow Badge
  2. Strings

    1. 2.1 Indexing

    2. Video 2.1.1 Indexing
    3. Check for Understanding 2.1.2 Indexing
    4. Example 2.1.3 Characters in a String
    5. Video 2.1.4 Unit Tests
    6. Practice 2.1.5 Initials
    7. Practice 2.1.6 Sandwich Sandwiches
    8. 2.2 Slicing

    9. Video 2.2.1 Slicing
    10. Check for Understanding 2.2.2 Slicing
    11. Example 2.2.3 Groups of Characters
    12. Example 2.2.4 String Collage
    13. Example 2.2.5 Room Names
    14. Practice 2.2.6 If You're Not First, You're Last
    15. Practice 2.2.7 Part 1, Replace a Letter
    16. Practice 2.2.8 Part 2, Replace a Letter
    17. Badge 2.2.9 Slicing Badge
    18. 2.3 Immutability

    19. Video 2.3.1 Immutability
    20. Check for Understanding 2.3.2 Immutability
    21. Example 2.3.3 String Immutability
    22. Exercise 2.3.4 Find the Error
    23. 2.4 Strings and For Loops

    24. Video 2.4.1 Strings and For Loops
    25. Check for Understanding 2.4.2 Strings and For Loops
    26. Example 2.4.3 The len Function
    27. Practice 2.4.4 Length of User's Name
    28. Example 2.4.5 String For Loop with Indices
    29. Example 2.4.6 String For Loop with Characters
    30. Exercise 2.4.7 Spelling Bee
    31. Practice 2.4.8 Keeping Count
    32. 2.5 The in Keyword

    33. Video 2.5.1 The in Keyword
    34. Check for Understanding 2.5.2 The in Keyword
    35. Example 2.5.3 Contains a Letter
    36. Example 2.5.4 Contains a Substring
    37. Practice 2.5.5 Contains a Vowel
    38. 2.6 String Methods

    39. Video 2.6.1 String Methods
    40. Check for Understanding 2.6.2 String Methods
    41. Example 2.6.3 upper and lower
    42. Practice 2.6.4 ENTHUSIASM!
    43. Example 2.6.5 swapcase
    44. Example 2.6.6 strip
    45. Example 2.6.7 find
    46. Practice 2.6.8 What's in a Name?
    47. Practice 2.6.9 Part 1, Remove All From String
    48. Exercise 2.6.10 Part 2, Remove All From String
    49. Survey 2.6.11 Mindset Survey 3
    50. 2.7 Strings Quiz

    51. Unit Quiz 2.7.1 Strings Quiz
    52. Badge 2.7.2 Strings Badge
  3. Project: The Game of Pig

    1. 3.1 Project: The Game of Pig

    2. Free Response 3.1.1 The Game of Pig
    3. Exercise 3.1.2 Build the Basic Program
    4. Exercise 3.1.3 Adding a Computer Opponent
  4. Creating and Altering Data Structures

    1. 4.1 Tuples

    2. Video 4.1.1 Tuples
    3. Check for Understanding 4.1.2 Tuples
    4. Example 4.1.3 A Tuple Is a Sequence
    5. Example 4.1.4 A Tuple is Heterogenous
    6. Example 4.1.5 Tuples With a Single Element
    7. Example 4.1.6 Concatenating Tuples
    8. Exercise 4.1.7 Fix This Tuple
    9. Practice 4.1.8 Citation
    10. Practice 4.1.9 Diving Contest
    11. Practice 4.1.10 Coordinate Pairs
    12. 4.2 Lists

    13. Video 4.2.1 Lists
    14. Check for Understanding 4.2.2 Lists
    15. Example 4.2.3 A List Is Like a Mutable Tuple
    16. Example 4.2.4 String <--> List
    17. Practice 4.2.5 Spell It Out
    18. Example 4.2.6 Splitting a String
    19. Practice 4.2.7 Listed Greeting
    20. Example 4.2.8 List of Tuples, Tuples of Lists
    21. 4.3 For Loops and Lists

    22. Video 4.3.1 For Loops and Lists
    23. Check for Understanding 4.3.2 For Loops and Lists
    24. Example 4.3.3 For Loops and Lists
    25. Example 4.3.4 For Loops and Lists, Part 2
    26. Practice 4.3.5 Max In List
    27. Practice 4.3.6 Owls
    28. Practice 4.3.7 Exclamat!on Po!nts
    29. Challenge 4.3.8 Word Ladder
    30. Challenge 4.3.9 Owls, Part 2
    31. 4.4 List Methods

    32. Video 4.4.1 List Methods
    33. Check for Understanding 4.4.2 List Methods
    34. Example 4.4.3 append and extend
    35. Exercise 4.4.4 How Many Names?
    36. Exercise 4.4.5 Five Numbers
    37. Example 4.4.6 sort
    38. Exercise 4.4.7 Librarian
    39. Example 4.4.8 reverse
    40. Example 4.4.9 count
    41. Example 4.4.10 remove
    42. Practice 4.4.11 Take a Thing Out, Sort It and Reverse It
    43. Challenge 4.4.12 Librarian, Part 2
    44. Badge 4.4.13 Lists Badge
    45. 4.5 Creating and Altering Data Structures Quiz

    46. Unit Quiz 4.5.1 Creating and Altering Data Structures Quiz
  5. Extending Data Structures

    1. 5.1 2d Lists

    2. Video 5.1.1 2d Lists
    3. Check for Understanding 5.1.2 2d Lists
    4. Example 5.1.3 A List of Lists
    5. Example 5.1.4 Grid
    6. Example 5.1.5 2d Lists and Slices
    7. Exercise 5.1.6 Checkerboard, v1
    8. Exercise 5.1.7 Checkerboard, v2
    9. Exercise 5.1.8 Checkerboard, v3
    10. Challenge 5.1.9 Tic Tac Toe
    11. 5.2 List Comprehensions

    12. Video 5.2.1 List Comprehensions
    13. Check for Understanding 5.2.2 List Comprehensions
    14. Example 5.2.3 List of Consecutive Numbers
    15. Example 5.2.4 List of Squares
    16. Exercise 5.2.5 Divisible by 3
    17. Example 5.2.6 Digits of Pi
    18. Example 5.2.7 List of Booleans
    19. Exercise 5.2.8 Last Names
    20. Exercise 5.2.9 Strings To Integers
    21. Survey 5.2.10 Mindset Survey 4
    22. 5.3 Packing and Unpacking

    23. Video 5.3.1 Packing and Unpacking
    24. Check for Understanding 5.3.2 Packing and Unpacking
    25. Example 5.3.3 Packing
    26. Example 5.3.4 Unpacking
    27. Example 5.3.5 Unpacking Parameters
    28. Exercise 5.3.6 Coordinate Pair
    29. Exercise 5.3.7 Slopes
    30. Example 5.3.8 Swapping
    31. Exercise 5.3.9 Full Name & Citation
    32. Badge 5.3.10 Packing Badge
    33. 5.4 Dictionaries

    34. Video 5.4.1 Dictionaries
    35. Check for Understanding 5.4.2 Dictionaries
    36. Example 5.4.3 Keys and Values
    37. Example 5.4.4 The in Keyword
    38. Exercise 5.4.5 Phone Book
    39. Exercise 5.4.6 Word Counts
    40. 5.5 Extending Data Structures Quiz

    41. Unit Quiz 5.5.1 Extending Data Structures Quiz
    42. Badge 5.5.2 Data Structures Badge
  6. Project: Guess the Word

    1. 6.1 Project: Guess the Word

    2. Demo 6.1.1 Guess the Word Demo
    3. Exercise 6.1.2 Guess the Word, Part 1
    4. Exercise 6.1.3 Guess the Word, Part 2
    5. Exercise 6.1.4 Guess the Word, Part 3
    6. Exercise 6.1.5 Guess the Word, Part 4
  7. File I/O

    1. 7.1 What is File I/O

    2. Video 7.1.1 What is File I/O
    3. Quiz 7.1.2 What is File I/O
    4. Example 7.1.3 What is a TXT File?
    5. Example 7.1.4 What is a CSV File?
    6. Free Response 7.1.5 Choosing a File Format: TXT vs. CSV
    7. Example 7.1.6 File I/O in Data Science
    8. Example 7.1.7 File I/O in Image Processing
    9. Free Response 7.1.8 File I/O and Social Media
    10. 7.2 Reading Character from File

    11. Video 7.2.1 Reading Character from File
    12. Video 7.2.2 Reading Characters from File: Example Walkthrough
    13. Quiz 7.2.3 Reading Characters from File
    14. Example 7.2.4 Read Specific Characters
    15. Example 7.2.5 Read All Characters
    16. Debugging 7.2.6 Fix This: Reading Characters
    17. Debugging 7.2.7 Fix This: Unable to Read
    18. Exercise 7.2.8 Validating Tweet Length
    19. 7.3 Reading Line from File

    20. Video 7.3.1 Reading Line From File
    21. Video 7.3.2 Reading Line from File: Example Walkthrough
    22. Quiz 7.3.3 Read Line from File
    23. Example 7.3.4 Reading and Printing Lines
    24. Exercise 7.3.5 Counting Lines in a File
    25. Exercise 7.3.6 Summing Numbers from File
    26. Exercise 7.3.7 Formatting Movie Titles
    27. 7.4 Reading All Lines from File

    28. Video 7.4.1 Reading All Lines from File
    29. Video 7.4.2 Reading All Lines from File: Example Walkthrough
    30. Quiz 7.4.3 Reading All Lines from File
    31. Example 7.4.4 Using readlines()
    32. Exercise 7.4.5 Finding the Needle in the Haystack
    33. Exercise 7.4.6 Extract Quotes from a Text File
    34. 7.5 Writing to File

    35. Video 7.5.1 Writing to File
    36. Video 7.5.2 Write to End of File: Example Walkthrough
    37. Quiz 7.5.3 Writing to File
    38. Example 7.5.4 Write to File
    39. Example 7.5.5 Append to File
    40. Exercise 7.5.6 Activity Tracker
    41. Exercise 7.5.7 Guest Book
    42. Exercise 7.5.8 Write the Sum
    43. 7.6 Move File Pointer Position

    44. Video 7.6.1 Move File Pointer Position
    45. Video 7.6.2 Move File Pointer Position: Example Walkthrough
    46. Quiz 7.6.3 Move File Pointer Position
    47. Example 7.6.4 Using tell()
    48. Example 7.6.5 Reading from a Position in File
    49. Exercise 7.6.6 Read from Middle
    50. Exercise 7.6.7 Reverse a File
    51. 7.7 File I/O Quiz

    52. Quiz 7.7.1 File I/O Quiz
  8. Exploring CS Careers

    1. 8.1 Computer Science Careers

    2. Video 8.1.1 Computer Science All Around Us
    3. Quiz 8.1.2 Computer Science All Around Us
    4. Connection 8.1.3 CS Careers
    5. Free Response 8.1.4 CS Career Response
    6. Connection 8.1.5 Coding in the Wild
    7. Free Response 8.1.6 Coding in the Wild Response
    8. Connection 8.1.7 Inclusive Coding
    9. Free Response 8.1.8 Inclusive Coding Response
    10. 8.2 Explore a Career

    11. Connection 8.2.1 How to Choose the Right Career Path
    12. Free Response 8.2.2 Step 1: Your Hobbies
    13. Free Response 8.2.3 Step 2: Your Talents
    14. Free Response 8.2.4 Step 3: Your Personality
    15. Free Response 8.2.5 Step 4: Your Career Aspirations
    16. Free Response 8.2.6 Step 5: Do Your Research
    17. Notes 8.2.7 Career Exploration Presentation Guidelines
    18. Presentation 8.2.8 Career Exploration Presentation
  9. Classes and Objects

    1. 9.1 Classes and Objects

    2. Video 9.1.1 Classes and Objects
    3. Check for Understanding 9.1.2 Classes and Objects
    4. Example 9.1.3 The Point Class
    5. Exercise 9.1.4 The Rectangle Class, Part 1
    6. Example 9.1.5 The Point Class, Part 2
    7. Exercise 9.1.6 The Rectangle Class, Part 2
    8. 9.2 Methods

    9. Video 9.2.1 Methods
    10. Check for Understanding 9.2.2 Methods
    11. Example 9.2.3 The Point Class, Part 3
    12. Example 9.2.4 The Point Class, Part 4
    13. Exercise 9.2.5 The Rectangle Class, Part 3
    14. Exercise 9.2.6 The Rectangle Class, Part 4
    15. 9.3 Built-In Methods

    16. Video 9.3.1 Built-In Methods
    17. Check for Understanding 9.3.2 Built-In Methods
    18. Example 9.3.3 The __repr__ method
    19. Example 9.3.4 The __eq__ method
    20. Example 9.3.5 The Point Class, Part 5
    21. Exercise 9.3.6 The Rectangle Class, Part 5
    22. Exercise 9.3.7 The Rectangle Class, Part 6
    23. Example 9.3.8 Sheet Music
    24. Challenge 9.3.9 Names In a Hat
    25. 9.4 Operator Overloading

    26. Video 9.4.1 Operator Overloading
    27. Check for Understanding 9.4.2 Operator Overloading
    28. Example 9.4.3 The __add__ method
    29. Example 9.4.4 The Point Class, Part 6
    30. Exercise 9.4.5 The Rectangle Class, Part 7
    31. Exercise 9.4.6 The Rectangle Class, Part 8
    32. Exercise 9.4.7 Contact Merge
    33. 9.5 Class Variables vs. Instance Variables

    34. Video 9.5.1 Class Variables vs. Instance Variables
    35. Check for Understanding 9.5.2 Class Variables vs. Instance Variables
    36. Example 9.5.3 The Point Class, Part 7
    37. Exercise 9.5.4 The Rectangle Class, Part 9
    38. Example 9.5.5 Cars
    39. Exercise 9.5.6 Cars, Part 2
    40. Example 9.5.7 Cars, Part 3
    41. 9.6 Inheritance

    42. Video 9.6.1 Inheritance
    43. Check for Understanding 9.6.2 Inheritance
    44. Example 9.6.3 Animals
    45. Exercise 9.6.4 Food, Part 1
    46. Example 9.6.5 Animals with Lists
    47. Exercise 9.6.6 Food , Part 2
    48. 9.7 Hidden Attributes

    49. Video 9.7.1 Hidden Attributes
    50. Check for Understanding 9.7.2 Hidden Attributes
    51. Example 9.7.3 Secret Instance Variable
    52. Exercise 9.7.4 Only Even Rectangles Counted
    53. Example 9.7.5 Level Up
    54. Exercise 9.7.6 Triple and Halve
    55. 9.8 Namespaces

    56. Video 9.8.1 Namespaces
    57. Check for Understanding 9.8.2 Namespaces
    58. Example 9.8.3 Classes
    59. Example 9.8.4 Subclasses
    60. Exercise 9.8.5 Food, Part 3
    61. 9.9 Modules

    62. Video 9.9.1 Modules
    63. Check for Understanding 9.9.2 Modules
    64. Example 9.9.3 Importing Entire Module
    65. Example 9.9.4 Importing Individual Components
    66. Free Response 9.9.5 Benefits of Individual Importing
    67. Exercise 9.9.6 Using the Math Module
    68. 9.10 Classes and Objects Quiz

    69. Unit Quiz 9.10.1 Classes and Objects Unit Test
    70. Badge 9.10.2 Classes and Objects Badge
  10. Final Exam

    1. 10.1 Final Exam

    2. Midterm 10.1.1 Final Exam Pt 1: Multiple Choice
  11. Python Graphics (Brython)

    1. 11.1 Creating Text & Lines

    2. Video 11.1.1 Creating Text & Lines
    3. Quiz 11.1.2 Creating Text & Lines
    4. Example 11.1.3 Hello World
    5. Example 11.1.4 "Tracy"
    6. Exercise 11.1.5 Tic Tac Toe Board
    7. Exercise 11.1.6 Underlined Name
    8. Challenge 11.1.7 Bubble Letter
    9. 11.2 Creating Shapes

    10. Video 11.2.1 Creating Shapes
    11. Quiz 11.2.2 Shapes and Attributes
    12. Example 11.2.3 Flag of Switzerland
    13. Exercise 11.2.4 Flag of Ukraine
    14. Exercise 11.2.5 Flag of [your choice!]
    15. 11.3 Creating Graphics Using Variables

    16. Video 11.3.1 Creating Graphics Using Variables
    17. Quiz 11.3.2 Creating Graphics Using Variables
    18. Example 11.3.3 Flag of Switzerland Using Variables
    19. Exercise 11.3.4 Flag of Ukraine Using Variables
    20. Exercise 11.3.5 Snowman
    21. Challenge 11.3.6 Ghost
    22. 11.4 Using Functions in Graphics

    23. Video 11.4.1 Using Functions in Graphics
    24. Quiz 11.4.2 Using Functions in Graphics
    25. Example 11.4.3 Forest
    26. Exercise 11.4.4 Vertical Lines
    27. Exercise 11.4.5 Stoplight
    28. Challenge 11.4.6 Ghost Invasion
    29. 11.5 Using Loops in Graphics

    30. Video 11.5.1 Using Loops in Graphics
    31. Quiz 11.5.2 Using Loops in Graphics
    32. Example 11.5.3 Diagonal Checkerboard
    33. Exercise 11.5.4 The Worm
    34. Exercise 11.5.5 Dartboard
    35. Challenge 11.5.6 Sidewalk
    36. 11.6 Graphics Challenges

    37. Challenge 11.6.1 Pyramid
    38. Challenge 11.6.2 Extended Forest
  12. Python Graphics (Tkinter)

    1. 12.1 Creating the Canvas

    2. Video 12.1.1 Creating the Canvas
    3. Check for Understanding 12.1.2 Creating the Canvas
    4. Example 12.1.3 Create the Canvas
    5. Example 12.1.4 X Marks the Spot
    6. Exercise 12.1.5 Tic Tac Toe Board
    7. Exercise 12.1.6 Bubble Letter
    8. 12.2 Shapes and Attributes

    9. Video 12.2.1 Shapes and Attributes
    10. Check for Understanding 12.2.2 Shapes and Attributes
    11. Example 12.2.3 Flag of Japan
    12. Exercise 12.2.4 Flag of Poland
    13. Exercise 12.2.5 Flag of [your choice!]
    14. 12.3 Creating Graphics Using Variables

    15. Video 12.3.1 Creating Graphics Using Variables
    16. Check for Understanding 12.3.2 Creating Graphics Using Variables
    17. Example 12.3.3 Flag of Japan Using Variables
    18. Example 12.3.4 Creating Shapes
    19. Exercise 12.3.5 Snowman
    20. Challenge 12.3.6 Ghost
    21. 12.4 Using Functions in Graphics

    22. Video 12.4.1 Using Functions in Graphics
    23. Check for Understanding 12.4.2 Using Functions in Graphics
    24. Example 12.4.3 Balloons
    25. Exercise 12.4.4 Vertical Lines
    26. Exercise 12.4.5 Stoplight
    27. Challenge 12.4.6 Ghost Invasion
    28. 12.5 Using Loops in Graphics

    29. Video 12.5.1 Using Loops in Graphics
    30. Check for Understanding 12.5.2 Using Loops in Graphics
    31. Example 12.5.3 Phone Signal
    32. Exercise 12.5.4 The Worm
    33. Exercise 12.5.5 Growing Circles
    34. Challenge 12.5.6 Sidewalk
    35. 12.6 Graphics Challenges

    36. Challenge 12.6.1 Block Tower
  13. Project: Who Said It?

    1. 13.1 Project: Who Said It?

    2. Video 13.1.1 File I/O
    3. Check for Understanding 13.1.2 File I/O
    4. Demo 13.1.3 Who Said It? Demo
    5. Exercise 13.1.4 Who Said It? - Part 1
    6. Exercise 13.1.5 Who Said It? - Part 2
    7. Exercise 13.1.6 Who Said It? - Part 3
    8. Exercise 13.1.7 Who Said It? - Part 4
    9. Badge 13.1.8 Who Said It? Badge
  14. Project: Mastermind

    1. 14.1 Let's Build Mastermind

    2. Connection 14.1.1 How to Play Mastermind
    3. Demo 14.1.2 Mastermind: Demo
    4. Exercise 14.1.3 Generate Number List
    5. Exercise 14.1.4 Get User Guess
    6. Exercise 14.1.5 Compare User Guess to List
    7. Exercise 14.1.6 Check if User has Won
    8. Exercise 14.1.7 Finish the Game!
  15. Assessment 2

    1. 15.1 Assessment 2

    2. Midterm 15.1.1 Assessment 2, Pt 1: Multiple Choice