Question: Using idle shell At the top of your program include comments: CPSC 1 4 0 Mod 4 A 1 Your Name The Date You should
Using idle shell
At the top of your program include comments:
CPSC ModA
Your Name
The Date
You should save the program as
ModAYourLastName.py
Problem Statement
Suppose you want to develop a program to play a lottery.
The program randomly generates a threedigit number,
prompts the user to enter a threedigit number, and
determines whether the user wins according to the
following rules:
If the user's input matches the lottery in the exact
order, the award is $
If all the digits in the user's input match all the digits in
the lottery number, the award is $
If one digit in the user's input matches a digit in the
lottery number, the award is $
Note that the digits of a threedigit number may be If a
number is less than we assume the number is
preceded by a to form a threedigit number. For
example, number is treated as If the number is
less than we assume the number is preceded by two
For example, number is treated as and number
is treated as in the program.
The basic outline of your program should be:
# Generate a lottery number
# Prompt the user to enter a guess
# Get digits from lottery number
# Get digits from user's guess
#print the lottery number
# Check the guess and print the result
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
