Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is Python Write a program that generates a lottery of a three-digit number. The program prompts the user to enter a three-digit number and
This is Python
Write a program that generates a lottery of a three-digit number. The program prompts the user to enter a three-digit number and determines whether the user wins according to the following rules: a. If the user input matches the lottery number in the exact order, the award is $10,000. b. If all digits in the user input match all digits in the lottery number, the award is $3,000. c. If one digit in the user input matches a digit in the lottery number, the award is $1,000. Here are sample runs: Enter your lottery pick (three digits): 591 Lottery is 248 Sorry, no match Enter your lottery pick (three digits): 987 Lottery is 637 Match one digit: you win $1,000 Enter your lottery pick (three digits): 683 Lottery is 836 Match all digits: you win $3,000 Enter your lottery pick (three digits): 494 Lottery is 494 Exact match: you win $10,000Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started