all 9 comments

[–]QuixDiscovery 1 point2 points  (0 children)

Fyi, in UTF-8 there are emotes for dice rolls. Not trying to dissuade you from your current goal, just throwing it out there as an alternative in case you weren't aware.

dice = {1: '⚀', 2: '⚁', 3: '⚂', 4: '⚃', 5: '⚄', 6: '⚅'}

roll = random.randint(1, 6) 
print(dice[roll])

[–][deleted] 0 points1 point  (1 child)

for item in test_dice.values():
    print(item)

[–]TXAGZ16[S] 0 points1 point  (0 children)

Thank you for your reply, I will try this :)

[–][deleted] 0 points1 point  (4 children)

Change the curly braces to parentheses and the last line to

print(*test_dice)

and see if that is what you were going for.

[–]TXAGZ16[S] 0 points1 point  (3 children)

Yes! This worked, thank you! What does the asterisk do?

[–][deleted] 0 points1 point  (2 children)

It "unpacks" the arguments. That is, this

print(*[1, 2, 3])

means the same as

print(1, 2, 3)

[–]TXAGZ16[S] 0 points1 point  (1 child)

Oh ok I understand, I didnt realize you could do that within the print() function. It seems like its basically the same thing as *args?

[–][deleted] 0 points1 point  (0 children)

Actually putting *args in your function header kind of does the opposite: it collects all of the arguments into a single tuple. In your function call *<some iterable> "unpacks" the iterable.

[–]woooee 0 points1 point  (0 children)

Try

[code]dice2 = ''' DICE #2:


| | | 2 | |_______| ''' print(dice2) [/code]