Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help I’m new at this
#4
instead of 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 method
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 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

Reply


Messages In This Thread
Need help I’m new at this - by Pelaw - Feb-13-2020, 02:13 PM
RE: Need help I’m new at this - by buran - Feb-13-2020, 02:17 PM
RE: Need help I’m new at this - by Pelaw - Feb-13-2020, 02:26 PM
RE: Need help I’m new at this - by buran - Feb-13-2020, 02:57 PM
RE: Need help I’m new at this - by Pelaw - Feb-13-2020, 03:25 PM
RE: Need help I’m new at this - by Pelaw - Feb-13-2020, 06:34 PM
RE: Need help I’m new at this - by ndc85430 - Feb-14-2020, 07:13 PM
RE: Need help I’m new at this - by Pelaw - Feb-15-2020, 03:07 AM

Forum Jump:

User Panel Messages

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