Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USE PYTHON Design and implement an application that simulates a simple slot machine in which three numbers between 0 and 9 are randomly selected and
USE PYTHON
Design and implement an application that simulates a simple slot machine in which three numbers between 0 and 9 are randomly selected and printed side by side. Print the appropriate statements (see below) if all three of the numbers are the same (Jackpot!!!), or if any two of the numbers are the same (Matched 2!!). Continue playing until the user chooses to stop.
Begin your script with the following 2 lines:
import random #import the random module random.seed(2) #dictates random sequence
Python Slot Machine 0 1 1 Matched 2!! Play again (y)?: Python Slot Machine 5 2 4 Sorry you lost! Play again (y)?: Python Slot Machine 4 9 3 Sorry you lost! Play again (y)?: Python Slot Machine 9 0 9 Matched 2!! Play again (y)?: Python Slot Machine 2 6 6 Matched 2!! Play again (y)?: Python Slot Machine 8 5 8 Matched 2!! Play again (y)?: Python Slot Machine 7 8 4 Sorry you lost! Play again (y)?: Python Slot Machine 0 0 5 Matched 2!! Play again (y)?: Thanks for playing!
Step 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