Question: Write a Python program to compute the winning award for a Cash 4 type lottery game . Here are the rules of the lottery

Write a Python program to compute the winning award for a " Cash 4" type lottery game . Here are the rules of the lottery game: 1. The winning combination is a list of four ( ) numbers from to 9 ( inclusive ) IN AN EXACT ORDER, Numbers can be repeated . 2. If numbers are guessed correctly IN THE EXACT ORDER , the cast award is $ . 3. If the FIRST number ONLY is guessed correctly, the cash award is $1. 4. If the FIRST and SECOND numbers ONLY are guessed correctly IN THE EXACT ORDER , the cash award is $50. 5. If the FIRST, SECOND, and THIRD numbers ONLY are guessed correctly IN THE EXACT ORDER , the cash award is $ 100. 6. If the FIRST, SECOND, THIRD, and FOURTH numbers are guessed correctly IN THE EXACT ORDER, the cash award is $ 1000 7. Below is a table summarizing the winnings : Number of correct Award guesses $ $1 $ 50 $ 100 $ 1,000 1 2 3 4 Here are the rules for the Python solution : 1. The winning numbers should be expressed in Python like winner = [ 2 , 6, 9, 7\ 2. The guessed numbers should be expressed in Python like : guess=[2 6 , 5 , 5 ] 3. You must use a for loop to check the list of numbers . 4. You must terminate the for loop as soon as an incorrect guess is detected . Unnecessary loops will cause some loss of grade points . 5. You must use if and elif statements for determining the award amount 6. You must print out the correct award amounts for any valid entry , like : Award payout is : $ 50 . 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!