Lottery Analysis: You can use a loop to see how hard it might be to win the kind of lottery you just modeled. Starting with your program in 9-14, write a loop that keeps pulling numbers until your ticket wins. Print a message reporting how many times the loop had to run to give you a winning ticket. Also print the winning ticket number so you can confirm it is on the winning ticket list. You may want to reduce the number of digits in your winning ticket for test purposes.
Lottery Analysis: You can use a loop to see how hard it might be to win the kind of lottery you just modeled. Starting with your
Your output may look something like this:
winning ticket list: ['2114AZAD', '8621ZDDA', '53310AABA', '11032DABD', '21071ADAZ', '6184AZZB', '10469DZDZ', '7436ZDBD', '10657DDDZ', '4944DDDA']
number_of_tries to win: 315416
possible winner: 7436ZDBD
Trending now
This is a popular solution!
Step by step
Solved in 3 steps