- Home
- Premium Memberships
- Lottery Results
- Forums
- Predictions
- Lottery Post Videos
- News
- Search Drawings
- Search Lottery Post
- Lottery Systems
- Lottery Charts
- Lottery Wheels
- Worldwide Jackpots
- Quick Picks
- On This Day in History
- Blogs
- Online Games
- Premium Features
- Contact Us
- Whitelist Lottery Post
- Rules
- Lottery Book Store
- Lottery Post Gift Shop
The time is now 10:39 am
You last visited
June 4, 2026, 10:59 pm
All times shown are
Eastern Time (GMT-5:00)
Going with a Python script QP for the power ball tonight...
Published:
Updated:
I have not updated power ball (or mega) histories since last year... that is a project for another day.
But, it is a bigger jackpot so I have a short script to generate a QP (using all possible numbers) that will be getting a run tonight.
Going to use sorted(random.sample(range(1,70),5)) for the white balls and random.randint(1, 26) for the red ball.
Note how range(1,70) will exclude the top of the range,.. so picking from 69 numbers requires the 70 at the top, BUT randint() picks between the range bottom and top, inclusive. Gotta love the strange python stuff...
My wife wants a machine generated QP, so there is a bit of a competition potential...

Comments
import random
white_balls = sorted(random.sample(range(1, 70), 5))
red_ball = random.randint(1, 26)
print(f" The WINNING white balls are: {white_balls}")
print(f" The WINNING red ball is : {red_ball}")
Nothing wrong with a little positivity...
Function RandComb(ByVal n As Integer, ByVal r As Integer) As String
Dim vs As Integer 'Value Selection
Dim v(9999) As Integer 'Values Array
Dim s(9999) As Boolean 'Sorted Selected Values Array
Dim textformat As String
For a = 1 To Int(Log(n) / Log(10)) + 1
textformat = textformat + "0"
Next a
textformat = textformat + " "
Dim temp As String 'Temporary String Storeage
temp = "" 'Initialize Temporary String
'Initialize Arrays
For a = 0 To 9999
v(a) = a
s(a) = False
Next
'Select R of N values
For a = 1 To r
vs = Int(Rnd * (n - a + 1)) + 1 'Randomly select a value from 1 to N of any remaining values less by previous selections
s(v(vs)) = True 'Set sorted select value array
'Shift to lower array positions those values greater than the current randomly selected value
For b = 1 To n - a
If b >= vs Then
v(b) = v(b + 1)
End If
Next
Next
'Add in order the selected values
For a = 1 To 9999
If (s(a)) Then temp = temp + Format(a, textformat)
Next
'Return the selected R of N values
RandComb = temp
End Function
Thanks, that is an interesting function.
I hear Microsoft is beta testing full Python embedded in apps like excel... that would be a dream come true !
Post a Comment
Please Log In
To use this feature you must be logged into your Lottery Post account.
Not a member yet?
If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.
Register