Search⌘ K

Challenge 2: Python Essentials

Explore fundamental Python concepts such as data types, operators, looping, and writing functions. Practice by creating a function to calculate discounted purchase costs with conditional logic, preparing you for data manipulation and analysis tasks.

Function to calculate a receipt

Let’s assume the following scenario: You’re a loyal customer at a store that’s offering the following discounts to its loyal customers:

  • For a purchase between 0 and 50 CAD, you get a 10 percent discount.
  • For
...