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 trialKushagra Patel
7,740 PointsSolution Check Advice
hi fellow learners I want to know does my solution approach is correct? Challenge gets passed.
def multiply(*args):
multi=1
for i in args:
multi=multi*i
return (multi)
call=multiply(2,3)
print("multiplication of the numbers : {}".format(call))
1 Answer
ursaminor
11,271 PointsYou have the right idea. A couple of small things: no need to put () around multi
. It's a number so you just need to return it. And I would call the variable something more accurate and clear, like product
, instead of multi
. Remember that coding is a form of communication -- make it easier for others to read and understand your code by using good variable names. This is important when you're working with others.
Kushagra Patel
7,740 PointsKushagra Patel
7,740 Pointsthanks a lot for your advice