Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Functional Python Functional Workhorses Map Comprehension

Create a function named area() that takes a single argument which will be a two-member tuple. area() should return the r

Create a function named area() that takes a single argument which will be a two-member tuple. area() should return the result of multiplying the first item in the tuple by the second item in the tuple.

Jake Kobs
Jake Kobs
9,215 Points

Do they mean this?:

def area (val):
    x,y = val
    return x * y

1 Answer

Ines Fazlić
seal-mask
.a{fill-rule:evenodd;}techdegree
Ines Fazlić
Python Web Development Techdegree Student 9,569 Points

Hi, you just make a function and then in it make a new variable...you can call it result for instance and in it you multiply items in a tuple..you can do that by indexing them. and then return variable(result). that way the tuple stays intact and you get your result.