Question: A small lottery was devised using three sets of balls. One ball from each set is drawn. To win the lottery you have to get
A small lottery was devised using three sets of balls. One ball from each set is drawn. To win the lottery you
have to get the correct number of the sum of the three balls. The sum of the balls cannot be divisible by or
The balls are redrawn until the sum is not divisible by or The first set of balls has the numbers through
dots, The second set of balls has the even numbers from to dots and the third set
counts by s to dots, Write a program that has as input a number that has been chosen by a lottery
participant winnumber The program should return the number of possible winning permutations for
winnumber winningpermutations and the total number of possible permuations totalpermutations
totalpermutations should not include permutations that are divisible by or
M def winwinnumber:return winningpermutations,totalpermutations
M
assert win
assert win
assert operatornamewin
Write a program that calls the function that you have just written, win to find the winnumber that is most
probable bestpick Please notice that you should return winnumber and not the number of winning
permutations of winnumber. If you have written win correctly, there is one winnumber that has the greatest
number of possible winning combinations.
Calling win returns two values. The following cell demonstrates how to call a function with more than one
returned value.
win
def maxwinnumber:return bestpick
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
