Home / Challenges / Apply Discount with Lambda

Apply Discount with Lambda

Easy
Write a function apply_discount(prices, percent) that takes a list of prices and a discount percentage, and returns a new list with each price reduced by that percentage. Use a lambda function with map().

Input

A list of numbers (prices) and a number (percent, e.g. 10 for 10%).

Output

A list of discounted prices, each rounded to 2 decimal places.

Example

Input
prices=[100, 200, 50], percent=10
Output
[90.0, 180.0, 45.0]
10 XP on solve Back to lesson

Your Solution

Output
Click "Run" to execute your code...

Log in to submit your solution and earn XP.