Conteúdo do Curso
Python Loops Tutorial
Python Loops Tutorial
Challenge
Tarefa
You need to update the provided products_list
. If a product's price is greater than $30, apply a 25% discount.
- Configure the
for
loop to iterate throughproducts_list
. - Establish the condition: If the price exceeds $30.
- Utilize
list.append(element)
to add an element to theupd_list
. - Apply a 25% discount to an element (price) if the price exceeds $30 by multiplying it by
0.75
. - Employ
round(element, value)
to round the price to the nearest cent. - If an element is $30 or lower (the
else
part), add it to theupd_list
without a discount. - Print the updated list.
Obrigado pelo seu feedback!
Challenge
Tarefa
You need to update the provided products_list
. If a product's price is greater than $30, apply a 25% discount.
- Configure the
for
loop to iterate throughproducts_list
. - Establish the condition: If the price exceeds $30.
- Utilize
list.append(element)
to add an element to theupd_list
. - Apply a 25% discount to an element (price) if the price exceeds $30 by multiplying it by
0.75
. - Employ
round(element, value)
to round the price to the nearest cent. - If an element is $30 or lower (the
else
part), add it to theupd_list
without a discount. - Print the updated list.
Obrigado pelo seu feedback!
Challenge
Tarefa
You need to update the provided products_list
. If a product's price is greater than $30, apply a 25% discount.
- Configure the
for
loop to iterate throughproducts_list
. - Establish the condition: If the price exceeds $30.
- Utilize
list.append(element)
to add an element to theupd_list
. - Apply a 25% discount to an element (price) if the price exceeds $30 by multiplying it by
0.75
. - Employ
round(element, value)
to round the price to the nearest cent. - If an element is $30 or lower (the
else
part), add it to theupd_list
without a discount. - Print the updated list.
Obrigado pelo seu feedback!
Tarefa
You need to update the provided products_list
. If a product's price is greater than $30, apply a 25% discount.
- Configure the
for
loop to iterate throughproducts_list
. - Establish the condition: If the price exceeds $30.
- Utilize
list.append(element)
to add an element to theupd_list
. - Apply a 25% discount to an element (price) if the price exceeds $30 by multiplying it by
0.75
. - Employ
round(element, value)
to round the price to the nearest cent. - If an element is $30 or lower (the
else
part), add it to theupd_list
without a discount. - Print the updated list.