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 Dates and Times in Python (2014) Let's Build a Timed Quiz App Timestamp Ordering

Trevor Wood
Trevor Wood
17,828 Points

Can I get some help on this code challenge?

It says to make a function that can handle any amount of arguments. I thought that functions could only handle a set number of arguments.

How can I do something like this? with a list?

If I could see what kind of code was going into the function I would have a better idea of how to tackle this challenge.

1 Answer

def foo(*args):
    for arg in args:
        print(arg)

foo(1, 2, 3, 4, 5)