Hello Mart,
I have done a new UK Lotto python script .
Its actions are like a combination of the initial idea, and the first posted version above.
It is still 4 lines long, but is less typing, it doesn't need all the numbers to be typed out.
I also added to the output text that it is the lotto numbers.
I have also added more comment lines in the code to explain better what each part is doing.
Screenshot of new UK Lotto number picker running in terminal on Linux Lite, and also showing code in Gedit.
Here is the code, I saved it to a Leafpad document in Home folder and name it next.py
To run this open your terminal by holding down Ctrl and Alt keys and pressing t (Ctrl+Alt+t) .
Then copy/paste or type into terminal -
then press Enter key.
Side note - removed other linux topic not on topic in this thread.
I have done a new UK Lotto python script .
Its actions are like a combination of the initial idea, and the first posted version above.
It is still 4 lines long, but is less typing, it doesn't need all the numbers to be typed out.
I also added to the output text that it is the lotto numbers.
I have also added more comment lines in the code to explain better what each part is doing.
Screenshot of new UK Lotto number picker running in terminal on Linux Lite, and also showing code in Gedit.
Here is the code, I saved it to a Leafpad document in Home folder and name it next.py
Code:
# imports random function
import random
# labelling for lotto number output
print ("Your UK lotto numbers are - ")
# Picks 6 random numbers between 1 and 59
# range goes to 60 so that 59 is inclusive, 60 is not inclusive
# .sample does not duplicate numbers picked
# Outputs these 6 results in a list
print(random.sample(range(1, 60),6))
# interactivity - prints options
print ("You have Options - " "\nDonate a percentage of any wins to your favorite project" "\nDonate the stake instead to your favorite project")
To run this open your terminal by holding down Ctrl and Alt keys and pressing t (Ctrl+Alt+t) .
Then copy/paste or type into terminal -
Code:
python next.py
Side note - removed other linux topic not on topic in this thread.