5.6.2 - Test: En la tienda Unit Test

Instructions:

- Read the code below and understand what it does.
- Run the code and verify its outputs.
- Determine if the code passes or fails the test.
- Identify any errors in the code.
- Write a summary that explains the purpose of the code and whether it passed or failed the test.

Code:

```python
def calculate_discounted_price(price, discount):
discounted_price = price - (price * discount)
return discounted_price

def test_calculate_discounted_price():
assert calculate_discounted_price(100, 0.1) == 90
assert calculate_discounted_price(50, 0.25) == 37.5
assert calculate_discounted_price(200, 0.05) == 190
assert calculate_discounted_price(80, 0.3) == 56
assert calculate_discounted_price(150, 0.2) == 120

test_calculate_discounted_price()
```

Summary:
The code defines a function called "calculate_discounted_price" that takes two parameters, "price" and "discount", and calculates the discounted price by subtracting the discount amount from the original price.
A separate function called "test_calculate_discounted_price" is also defined to test the "calculate_discounted_price" function. It uses assert statements to compare the calculated discounted price with the expected values for different test cases.
The code passes the test if all the assert statements are True, indicating that the calculated discounted prices match the expected values.