instead of
you can do
However, there is much bigger problem in your code - Lottery.lotteryLogic
This should be an instance method, and you should pass
Then create an instance and call the method.
You may pass max value when instantiate the object and only call the draw method with number of balls you want
Finally curently you can get repeating numbers (i.e. drawing one number, that is already in the previous 5)
I don't know
str(Lottery.lotteryLogic(1, 46, 6)
you can do
', '.join(Lottery.lotteryLogic(1, 46, 6))
However, there is much bigger problem in your code - Lottery.lotteryLogic
This should be an instance method, and you should pass
self
as first argument. Probably draw()
would be better name for this methodThen create an instance and call the method.
You may pass max value when instantiate the object and only call the draw method with number of balls you want
Finally curently you can get repeating numbers (i.e. drawing one number, that is already in the previous 5)
I don't know
ui
module and cannot advise, but creating gui in a function is bit odd.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs