Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Easy Unpack by RaN
def easy_unpack(elements):
pack_list = []
pack_list.append(elements[0])
pack_list.append(elements[2])
pack_list.append(elements[-2])
pack_tuple = tuple(pack_list)
return pack_tuple
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert easy_unpack((1, 2, 3, 4, 5, 6, 7, 9)) == (1, 3, 7)
assert easy_unpack((1, 1, 1, 1)) == (1, 1, 1)
assert easy_unpack((6, 3, 7)) == (6, 7, 3)
print('Done! Go Check!')
Dec. 17, 2017