Question

Use Python: Dice Rolls Create a function named build_roll_permutations which returns all 36 permutations of rolling...

Use Python:

Dice Rolls

Create a function named build_roll_permutations which returns all 36 permutations of rolling two six sided dice. That is, each dice has a number 1 through 6 on one of its sides. The return value is a list which contains tuples. Each tuple represents a possible dice roll of two dice.

Card Deck

Create a function named build_deck that returns a full deck of cards. The cards are created by a rank and a suit (e.g. 2♡). The return value is a list of 52 strings.

  • The rank must be in A,2,3,4,..,9,10,J,Q,K order

  • The suits must be in ♢♣♡♠ order.

So all the ♢s come first, then ♣, then ♡, then ♠.

Multiplication Table

Create a function named create_multiplication_table that has two parameters: m, n. The function returns a table which is simply a list of rows. Each row is another list with the values.

The value at table[row][col] is the row*col. So the following should work:

 
 

table = create_multiplication_table(6,6)

 

print(table[4][3]) # should see 12

 

print(table[6][6]) # should see 36

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you need more help with it let me know in the comment section also a like would be highly appreciated. Thanks and Keep Learning :)

def build_roll_permutations_way_1(): dice 1 = [1,2,3,4,5,6] dice_2 = dice_1[:] # made a copy of dice 1 result list = [] for i

Add a comment
Know the answer?
Add Answer to:
Use Python: Dice Rolls Create a function named build_roll_permutations which returns all 36 permutations of rolling...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT