Welcome to the Treehouse Community
Looking to learn something new?
Calvin Hoag8,515 Points
Unhelpful error feedback
Challenge Task 1 of 4 says "Let's start by writing a function named product_sales that takes a single two-member tuple made up of a price and a number of units sold. product_sales should return the product of the price and the number of units." - I don't know if I have the answer or not but neither the video, or the error feedback is being helpful. I don't understand where the error "Bummer! product_sales threw an exception when given the argument (10.5, 2)"
prices = [ (6.99, 5), (2.94, 15), (156.99, 2), (99.99, 4), (1.82, 102) ] def product_sales(x, y): return x * y
Steven Parker216,017 Points
Those "bummer" messages aren't always helpful.
So here's some hints:
- the challenge says the function should take a single argument (yours currently takes two).
- the argument will be a two-member tuple, so you will subscript it to get the 2 values
- subscripting is done with brackets ("
- the indexes of tuple members starts with 0