Oct-04-2020, 12:40 PM
(Oct-04-2020, 12:33 PM)hshivaraj Wrote: Negative indexing reads value from backwards. For instance
>>> a = [1, 2, 3] >>> a[-1] 3 >>> a[-2] 2 >>> a[0] 1 >>> a[1] 2I hope that give some explanation of the behaviour
I understand the negative indexing part using a list. I'm trying to understand how it works on the coin toss example
If you threw tails 4 times .... wouldn't -4 + 0 (from tails = [0} ........ come to -4?
Apologies for not understanding .... I'm a newbie :-)