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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Martin Heinvee](https://secure.gravatar.com/avatar/235078489e4b7525ddd9e28387314921?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Martin Heinvee
872 PointsTask about using slices-solution not passing the challenge.
In python collections course I am stuck with the following task:
Challenge Task 2 of 4: Make a new function named first_and_last_4. It'll accept a single iterable but, this time, it'll return the first four and last four items as a single value.
My solution gets a 'bummer' for the following solution: If item2 = 'kukeleegu' then my solution gives 'kukeugee' and if item2 = [1,2,3,4,5,6,7,8,9] then 12349876. I believe that these are correct answers and solution should be bassed but I will get a 'bummer', why ? Can anyone help me with that ?
def first_and_last_4(item2):
uus=[]
for i in item2:
character=str(i)
uus.append(character)
string1 = ''.join(uus)
return string1[0:4:1]+string1[-1:-5:-1]
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsIt looks like you're reversing the order of the last 4 items, but the instructions don't ask for that. Just return the first and last 4 items in their original order.
![Martin Heinvee](https://secure.gravatar.com/avatar/235078489e4b7525ddd9e28387314921?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Martin Heinvee
872 PointsThanks for the comment Steven! Yes the last four were backwards, but still the solution is not passed. I re-posted the issue in a better form.