Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Slot machines are a common game of chance in casinos. A player spins a set of wheels with symbols on them and tries to match

Slot machines are a common game of chance in casinos. A player spins a set of wheels with symbols on them and tries to match up symbols to win.
win.
Your slot machine class contains the following methods:
constructor are num =4, symbols =[rock', 'paper', 'scissors']. This will create a Slot_Machine object with 4 wheels. Each wheel contains the symbols rock, paper, and scissors.
value might be [rock',rock','paper','paper'].
The skeleton of the class definition is:
from random import choice, choices, randint, sample
class Slot_Machine:
def _(self, num, symbols = None):
self.__symbols =['cherries', 'lemon', '7', 'gold bar']
if symbols 1= None:
self._symbols = symbols
self. wheels = num
def sn(self) :
#fLLL in
We want to then do the following:
-Creates a Slot_Machine object called bandit that has 5 wheels. Each wheel contains the symbols 'turtle' and 'potato'
-Spin bandit 10 times and save the output from all of the spins in a list
From the lines of code below, select one line to fill in the spin method (match this to spin), and the the two lines of the main program in the correct order (match these to Main 1 and Main 2
respectively). There are additional answer choices that you will not use.
Partial Credit allowed. Negative Scores turned on: -15% for each incorrect answer.
spin method
Main 1
Main 2
A. results =[bandit.sn() for i in range (10)]
B. results =[spin (bandit) for i in range (10)]
C. return choices(self._symbols, k= self._wheels)
D. bandit = Slot_Machine init_()
E. return choices (symbols,x= wheels)
F. bandit =3lot_Machine ('turtle', 'potato')
G. results for i in range (10)
image text in transcribed

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

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

BPR always involves automation. Group of answer choices True False

Answered: 1 week ago