I want to print a list, perform some operations and print again, flushing the list.
a=[1,2,3,4,5,6,7,8,9]
for i in range (0, 10):
a.append(i)
a=a[-5:]
print(*a, sep='\n')
I expect the list to be cleared from the screen and the new one takes its place, buy I don't know how to to that.