finding whether all elements in the list are same or not based on the following scenario:-
I am getting price value at every 5 min interval.for first 20 min. I have to simply store these value somewhere for further comparison. I am creating list for that purpose:
initPrice=[] // create empty list
after that, I am appending values to list by using:
initPrice.append(someValue)
so till 20 min, means 4 values will be appended to list. like:-
initPrice=[20,23,20,40]
Now I have to check whether all elements in the list are same or not. so I did-
if(len(set(initprice))<2):
print("TRUE")
else:
print("FALSE")
but the scenario is like live streaming data, so after every 20 min, I want to do the same task again and again on the list, without increasing the length size. its more look like queue first in first out,so after every 20 min, I am doing the same task on updated value. the only problem with list.append is it will increase the list size, that i dont want.
it's like after every 5 min new value should store at one end and older value should remove from another end, that's why i said its more look like FIFO mechanisms