Course Content
Python Loops Tutorial
Python Loops Tutorial
Challenge
Task
You need to update the given products_list
. If the price is greater than 30, you need to set a discount = 25%.
- Set the
for
loop to work withproducts_list
. - Set the condition if the price is greater than 30.
- Use
list.append(element)
to add an element to theupd_list
. - Set the discount to an element (price), if the price is greater than 30 by multiplying by
0.75
. - Use
round(element, value)
to round the price to the 00.00 format. - If an element is lower or equal to 30 (
else
part), add an element without a discount to theupd_list
. - Print an updated list.
Everything was clear?
Section 1. Chapter 9