overview.md 506 Bytes

Lecture 08 Overview

Keyword Arguments

  • You can provide "optional" arguments in python

New List Functionality

  • lst[-1]
  • list.pop()
  • list.pop(0)

More Dictionaries

  • d.keys()
  • d.values()
  • Cumulative Algorithm Patttern for dictionaries

Case Study: A Joke Teller!

  • get_n_jokes(n: int, type: JokeType = "any") -> list[Joke]
  • find_best_joke(jokes: dict[int, Joke], joke_ratings: dict[int, int])
  • get_average_joke_rating(ratings: dict[int, int])
  • tell_jokes(n: int = 3)