Welcome to the Treehouse Community
Looking to learn something new?
Emil Hejlesen3,014 Points
how do you do the second task
create a funtion that takes the first four and four last please help
def first_4(liste): return liste[:4] def first_and_last_4(liste2): return liste2[:4:-5:-1]
You will need to add two slices together for the first_and_last_4 piece. You already solved the first four problem so you can use that code and then add '+' another slice of just the last four. You can use negative indexes to indicate from the end.