Exercises#
Please select the week you wish to work on
- Exercises for testing your installation
- Week 1: Introduction
- Exercise 1.1: Before we get started
- Exercise 1.2: Installation
- Exercise 1.3: Using Python in the terminal
- Exercise 1.4: Creating a Python script
- Exercise 1.5: Revisiting Exercise 1.1
- Exercise 1.6: Built-in functions and operators
- Exercise 1.7: Working with strings
- Exercise 1.8: Swapping value of variables
- Week 2: Functions
- Exercise 2.1: Full name
- Exercise 2.2: Next thousand
- Exercise 2.3: Name length
- Exercise 2.4: Wind chill
- Exercise 2.5: Normal weight
- Exercise 2.6: Survival temperature
- Exercise 2.7: Unit conversion
- Exercise 2.8: Hadlock’s formula for fetal growth
- Exercise 2.9 (optional): Keyword arguments and default values
- Week 3: Conditionals, recursion, and frutiful functions
- Videos (Watch this before the other videos)
- Exercise 3.1: Relational operators
- Exercise 3.2: Logical operators
- Exercise 3.3: Function with return value
- Exercise 3.4: Classify body temperature using the
if
statement - Exercise 3.5: Comparing numbers
- Exercise 3.6: Blood alcohol concentration calculator
- Exercise 3.7: Solar panel installation
- Exercise 3.8: Risk of heart attack
- Exercise 3.9: Exponential function
- Exercise 3.10: Ackermann function
- Exercise 3.11: The bisection algorithm.
- Exercise 3.12: Concluding there is a root
- Exercise 3.13: Bisection
- Videos (Watch this before the other videos)
- Week 4: Iteration and string
- Videos (Watch this before the other videos)
- Exercise 4.1: Square roots
- Exercise 4.2: Efficiently computing pi
- Exercise 4.3: Is it a palindrome?
- Exercise 4.4: The last bug
- Exercise 4.5: Writing pretty signs to the console
- Exercise 4.6: Parenthesis matching
- Exercise 4.7: The inner-most expression (Challenge problem!)
- Exercise 4.8: Matching parenthesis
- Exercise 4.9: Getting the dialogue
- Exercise 4.10: Common prefixes
- Exercise 4.11: Common prefixes of three words
- Project exercises: Hangman! Introduction
- Exercise 4.12: Hangman! Is the word guessed?
- Exercise 4.13: Hangman! What letters are available?
- Exercise 4.14: Hangman! Format the current guess
- Exercise 4.15: Hangman! Putting it all together
- Videos (Watch this before the other videos)
- Week 5: Lists
- Exercise 5.1: Warm-up with lists
- Exercise 5.2: Average of a list
- Exercise 5.3: Conditional maximum
- Exercise 5.4: Find the tallest animal
- Exercise 5.5: Short words
- Exercise 5.6: Check if the list is rectangular
- Exercise 5.7: Vector addition
- Exercise 5.8: Count Multiples
- Exercise 5.9: Create list containing multiples
- Exercise 5.10: Water height
- Exercise 5.11: Best buy
- Exercise 5.12: Tic Tac Toe - Printing the board
- Exercise 5.13: Tic Tac Toe - Update board
- Exercise 5.14: Tic Tac Toe - Get game state!
- Exercise 5.15: Tic Tac Toe - Putting everything together!
- Week 6: Dictionaries
- Exercise 6.1: Text to NATO
- Exercise 6.2: Letter histogram
- Exercise 6.3: Word histogram
- Exercise 6.4: Extracting most commonly occurring words that are not part of a list.
- Exercise 6.5: Find language speakers from a group of people.
- Exercise 6.6: Truncate the values in a list of floats.
- Exercise 6.7: Sentiment analysis
- Exercise 6.8: Spell check
- Exercise 6.9: Multi-tap entry
- Week 7: Tuples and data structure
- Week 8: Files
- Introduction: Paths
- Exercise 8.1: Reading a text file
- Exercise 8.2: Loading a text file to a string and a list
- Exercise 8.3: Saving a text file
- Exercise 8.4: Counting words and letters in a text file
- Exercise 8.5: Reading and saving a csv file
- Exercise 8.6: How common is your last name?
- Exercise 8.7: Plotting data
- Exercise 8.8: Guess the language of a text
- Exercise 8.9: Bacteria growth experiment
- Exercise 8.10: Optional Saving a pickle file
- Week 9: Classes 1
- Exercise 9.1: Rectangle - Calculating Perimeter
- Exercise 9.2: Rectangle - Retrieving Corner Coordinates
- Exercise 9.3: Rectangle - Plotting Rectangles
- Exercise 9.4: Vector - Introduction
- Exercise 9.5: Vector - Scaling
- Exercise 9.6: Vector - Addition
- Exercise 9.7: Vector - Dot-product
- Exercise 9.8: Translating Rectangles
- Week 10: Classes 2
- Exercise 10.1: Inheritance - ExtendedString.to_snake_case()
- Exercise 10.2: Inheritance - ExtendedString.word_count()
- Exercise 10.3: Inheritance - Student
- Exercise 10.4: Operator Overloading - Vector Addition
- Exercise 10.5: Operator Overloading - Vector Subtraction
- Exercise 10.6: Operator Overloading - Dot Product
- Exercise 10.7: Shopping Cart - Item
- Exercise 10.8: Shopping Cart Inventory
- Week 11: Numerical python and plotting
- Exercise 11.1: Warm-up with NumPy
- Exercise 11.2: Warm-up with NumPy 2D arrays
- Exercise 11.3: Logical Indexing
- Exercise 11.4: Array Operations and Modification
- Exercise 11.5: Revisiting the List Exercises from Week 5
- Exercise 11.6: Indexing Images
- Exercise 11.7: Bacteria: Growth
- Exercise 11.8: Bacteria - Average growth curve
- Exercise 11.9 Bacteria - Outliers
- Exercise 11.10 Image Area
- Week 12: Algorithms and efficiency
- Week 13: Summary and discussion of the exam