Get startedGet started for free

Adding tax

Time to test out your lambda function skills!

In this exercise, you'll use a lambda function to add a tax of 20% to the cost of the sale_price variable.

This exercise is part of the course

Intermediate Python for Developers

View Course

Exercise instructions

  • Define the add_tax lambda function to multiply the argument provided to it, x, by 1.2.
  • Call add_tax() on the sale_price variable.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

sale_price = 29.99

# Define a lambda function called add_tax
add_tax = ____

# Call the lambda function
print(____(____))
Edit and Run Code