Discrepancy in time taken for compuatation in tuples and lists

I find that sometimes in google colab when I compute square of tuple, it is taking more time than the same computation of lists

Can someone explain please?

Hi @sid13,
Can you please share more details, like a screenshot?
Is it happening sometimes or every time?

As tuples are immutable they take less time than lists, when operations are performed on them.

But in the above example done on google collab
Time taken by list is less than time taken by tuple.
link for list code :- https://colab.research.google.com/drive/1iGBlgRLSE2KeGMLU8BzxVqjUPqRqkAgZ#scrollTo=cqSfF2nulEK5&line=1&uniqifier=1

link for tuple code:- https://colab.research.google.com/drive/1iGBlgRLSE2KeGMLU8BzxVqjUPqRqkAgZ#scrollTo=pf_jiy5XlaYK&line=2&uniqifier=1

Please note that sometimes it takes time while loading variables etc. when we perform the operations for first time, there could be an overhead in that case.
Can you rerun those cells again and again and check, the performance for tuples would be better than lists after a few iterations.

Man, I have already tried it couple of times. But it didn’t work. Yet, I do not get the exact logic behind it. But the list always execute in less time than the tuples.