Skip to content
KALANBLON
Show contents

Chapter 3 of 7 · 10 min

Quiz: a professional project

Type annotations, virtual environments, pytest and logging: let's check that your project is ready for a team. You need 70 % correct answers, and every answer is explained.

Quiz

5 questions · pass mark: 70%

  1. 1.What happens at run time if you call total(["3"]) with def total(prices: list[float])?

    One answer

  2. 2.What does the return annotation -> float | None mean?

    One answer

  3. 3.Which good practices concern a project's dependencies? (several answers)

    Several answers possible

  4. 4.Complete the pytest decorator that runs the same test with several values.

    Complete the code

    @pytest.mark.___________("quantity", [0, -1, 11])
    def test_invalid_sale(stock, quantity): ...
  5. 5.The logger is set to INFO. What happens to log.debug("detail")?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.