Question: Unroll the code below. Hint: np . random.randint returns a random integer between 0 ( inclusive ) and the value that's passed in ( exclusive

Unroll the code below.
Hint: np.random.randint returns a random integer between 0(inclusive) and the value that's passed in (exclusive).
# This table will hold the cards in a randomly-drawn hand of
# 5 cards. We simulate cards being drawn as follows: We draw
# a card at random from the deck, make a copy of it, put the
# copy in our hand, and put the card back in the deck. That
# means we might draw the same card multiple times, which is
# different from a normal draw in most card games.
hand = Table().with_columns("Rank", make_array(), "Suit", make_array())
for suit in np.arange(5):
card = deck.row(np.random.randint(deck.num_rows))
hand = hand.with_row(card)
hand
Rank Suit
J
Q
J
J
5
...
hand = Table().with_columns("Rank", make_array(), "Suit", make_array())
...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!