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 trialAbdul Kader
3,504 PointsI dont understand the question. How do you define an utterable which can be anything?
nil
def first_4():
num = [1,2,3,4,5]
return num[:4]
print(first_4())
1 Answer
Austin David
6,516 PointsThe first_4 function take any iterable as a argument like so: def first_4(arg): # arg can be any iterable # code to return first four items
Then you call it like so: print(first_4([1,2,3,4,5]))