I think my program is complete, but ... it does not work. I am trying to write a program that simulates a lottery game, but when I try to verify that the user is guessing the number of guesses on the ticket, I get an error message that tells me that "the list index is out of range." I think this has something to do with the part of the code where I assign the random digits "a", "b", "c", etc. But I'm not sure.
Here is the complete code:
import random def main(): random.seed()
And here is the error I get:
Traceback (most recent call last): File "C:\Users\Ryan\Downloads\Program # 2\Program # 2\lottery.py", line 85, in <module> main() File "C:\Users\Ryan\Downloads\Program # 2\Program # 2\lottery.py", line 45, in main nummatches = checkmatch(winning_numbers, guess) File "C:\Users\Ryan\Downloads\Program # 2\Program # 2\lottery.py", line 79, in checkmatch if guess[i] == winning_numbers[i]: IndexError: list index out of range
source share