Skip to main content

Timeline for Lottery number picker

Current License: CC BY-SA 4.0

13 events
when toggle format what by license comment
May 30 at 16:23 history edited Sᴀᴍ Onᴇᴌᴀ CC BY-SA 4.0
adjust wording slightly to refer to the code instead of the OP
Apr 13, 2017 at 12:40 history edited CommunityBot
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Nov 1, 2014 at 23:28 vote accept Frank Tudor
Nov 1, 2014 at 23:13 comment added jonrsharpe @FrankTudor not quite, it's only half-open - the lower bound is included, so range(1, 50) would give 1-49 inclusive. See e.g. here for why. Rather than writing stuff without knowing why, work through a tutorial to get a more structured introduction - docs.python.org/3/tutorial/controlflow.html#the-range-function.
Nov 1, 2014 at 23:12 comment added Frank Tudor @jonsharpe (hahaha)...I am also doing all this stuff because its my first python program. I don't know what I am doing yet :)
Nov 1, 2014 at 23:10 comment added Frank Tudor @jonsharpe Ahhhh! Now this will happens even if I am explicit and say 1-50 (because I want 1-50) Python will do 0-49 unless I clip on that +1, is this assumption correct?
Nov 1, 2014 at 23:06 comment added jonrsharpe @FrankTudor why are you doing it if you don't know what it means?! +1 is necessary because range is "half-open", i.e. excludes the final argument (e.g. range(10) gives 0, 1, ..., 8, 9 but not 10).
Nov 1, 2014 at 23:04 comment added Frank Tudor @jonsharpe Question: In my code there is something I am doing but I don't know what it means. Simplified example random.sample(range(1,50+1),5) That +1 (what does that mean?)
Nov 1, 2014 at 23:01 comment added Frank Tudor Very cool! Ok, I am seeing the dictionary is a very viable alternative here. I was get else if'd out of my mind :)
Nov 1, 2014 at 23:00 history edited jonrsharpe CC BY-SA 3.0
Added missing docstring
Nov 1, 2014 at 22:46 history edited jonrsharpe CC BY-SA 3.0
Example implementation
Nov 1, 2014 at 22:39 history edited jonrsharpe CC BY-SA 3.0
added 2644 characters in body
Nov 1, 2014 at 22:16 history answered jonrsharpe CC BY-SA 3.0