Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coin Toss - Distribution
#3
(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]
2
I 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 :-)
Reply


Messages In This Thread
Coin Toss - Distribution - by lasek723 - Oct-04-2020, 12:26 PM
RE: Coin Toss - Distribution - by hshivaraj - Oct-04-2020, 12:33 PM
RE: Coin Toss - Distribution - by lasek723 - Oct-04-2020, 12:40 PM
RE: Coin Toss - Distribution - by hshivaraj - Oct-04-2020, 01:02 PM
RE: Coin Toss - Distribution - by deanhystad - Oct-04-2020, 01:07 PM
RE: Coin Toss - Distribution - by lasek723 - Oct-04-2020, 01:18 PM
RE: Coin Toss - Distribution - by deanhystad - Oct-04-2020, 01:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  distribution fit Glaucio 1 288 Apr-07-2024, 12:30 AM
Last Post: Larz60+
  Weight Distribution 11drk9 11 874 Mar-13-2024, 06:08 AM
Last Post: Pedroski55
  Are there errors in the code for my coin toss systems? Matlibplot is too perfect . Coolkat 0 421 Nov-13-2023, 11:54 AM
Last Post: Coolkat
Information Best distribution method inovermyhead100 0 603 Jul-19-2023, 07:39 AM
Last Post: inovermyhead100
  How do I use a whl puython distribution? barryjo 6 1,876 Aug-15-2022, 03:00 AM
Last Post: barryjo
  [split] Coin Flip Program Crackity 5 4,909 Sep-25-2017, 03:48 AM
Last Post: Crackity
  Coin Flip Program Warbit 6 8,241 Mar-27-2017, 11:33 PM
Last Post: Warbit

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020