On Mon, Dec 16, 2013 at 12:26 AM, <shengjie.sheng...@live.com> wrote: > The idea is to grab the last 4 elements of the array. However i have an array > that contains a few hundred elements in it. And the values continues to > .append over time. How would i be able to display the last 4 elements of the > array under such a condition?
I assume you mean 'list' rather than 'array'. If all you want to do is 'display' the last 4 elements: big_list = [0,1,2,3,4,5,6,7,8,9] last4 = big_list[-4:] print(last4) -- https://mail.python.org/mailman/listinfo/python-list