Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program Write a program that randomly generates a number from 0-99 (inclusive), prompts the user to enter a number from 0- 99,

Write a Python programimage text in transcribed

Write a program that randomly generates a number from 0-99 (inclusive), prompts the user to enter a number from 0- 99, and prints out how much is won according to the following rules: If the user's input matches the lottery number in the exact order, the award is $10,000 If all the digits in the user's input match all the digits in the lottery number but in a different order, the award is $3,000 If only one digit in the user's input matches one digit in the lottery number, the award is $1,000 How can we get the individual digits? Assume num is a number from 0-99. num // 10 gets tens digit. num % 10 gets ones digit. HINT: Print the random number before prompting for a number. This will make it easier to test. The sample runs do this. Sample Run 1 20 Enter a number from 0-99: 32 You won $1000 dollars. Sample Run 2 21 Enter a number from 0-99: 12 You won $3000 dollars

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions