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 Python Collections (2016, retired 2019) Tuples Packing

Hussein Amr
Hussein Amr
2,461 Points

what's wrong

the program works in the workspaces.. maybe I understood the steps wrong

twoples.py
def multiply(*args):
    firstnum = 43
    secondnum = args[0]
    product = firstnum * secondnum
    print(product)
multiply(25)

Hi Hussein, I have a couple of suggestions. One of the requirements is that you create a function that takes ANY NUMBER of arguments. Therefore when you call the function you should be using multiple arguments like multiply (4, 25, 7). If you think about what you will be sending in through *args is then multiple values which then obligates you to the use of a loop to handle the object you sent in (a list). List functions will be helpful to get a number from the list for multipication and working with the ongoing total.

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,426 Points

You will need to loop through your args with for arg in args:, then multiply the products, (Hint: use 1 as the starting value). Remember to return the final product, not print it.

Post back if you need more help. Good luck!!