Skip to content

Exercise 5 (Code Completion)

  1. Start typing a python function that returns the list of all prime numbers less than a given integer n.
  2. Ask AI to act as Google engineer to improve the previous code.
  3. Evaluate and test the code. Is it still working ? Is the code really improved? How do you know it’s better?
  4. If not already present, ask for error handling, proper typing.
  5. Do you agree ? Inspect carefully.
  6. Ask for unit tests following Max’s advices. Ask why are the suggested tests relevant.