filmov
tv
Beginner Python - Using Dictionary (Dice Roller Game Tutorial)

Показать описание
#python #pythonprogramming #coding #tutorial #mentor
Let's see how we can use a Dictionary in our game, also what is the difference between a List and a Dictionary? We will see the answer to that as well.
#copy and paste this dictionary into your code for the dice styling
DICE_ART = {
1:
"┌─────────┐ \n"
"│ │ \n"
"│ ● │ \n"
"│ │ \n"
"└─────────┘ \n"
,
2:
"┌─────────┐ \n"
"│ ● │ \n"
"│ │ \n"
"│ ● │ \n"
"└─────────┘ \n"
,
3:
"┌─────────┐ \n"
"│ ● │ \n"
"│ ● │ \n"
"│ ● │ \n"
"└─────────┘ \n"
,
4:
"┌─────────┐ \n"
"│ ● ● │ \n"
"│ │ \n"
"│ ● ● │ \n"
"└─────────┘ \n"
,
5:
"┌─────────┐ \n"
"│ ● ● │ \n"
"│ ● │ \n"
"│ ● ● │ \n"
"└─────────┘ \n"
,
6:
"┌─────────┐ \n"
"│ ● ● │ \n"
"│ ● ● │ \n"
"│ ● ● │ \n"
"└─────────┘ \n"
,
}
If you need help with any coding please do not hesitate to reach out to me or sign up for a mentor session at my website!
Let's see how we can use a Dictionary in our game, also what is the difference between a List and a Dictionary? We will see the answer to that as well.
#copy and paste this dictionary into your code for the dice styling
DICE_ART = {
1:
"┌─────────┐ \n"
"│ │ \n"
"│ ● │ \n"
"│ │ \n"
"└─────────┘ \n"
,
2:
"┌─────────┐ \n"
"│ ● │ \n"
"│ │ \n"
"│ ● │ \n"
"└─────────┘ \n"
,
3:
"┌─────────┐ \n"
"│ ● │ \n"
"│ ● │ \n"
"│ ● │ \n"
"└─────────┘ \n"
,
4:
"┌─────────┐ \n"
"│ ● ● │ \n"
"│ │ \n"
"│ ● ● │ \n"
"└─────────┘ \n"
,
5:
"┌─────────┐ \n"
"│ ● ● │ \n"
"│ ● │ \n"
"│ ● ● │ \n"
"└─────────┘ \n"
,
6:
"┌─────────┐ \n"
"│ ● ● │ \n"
"│ ● ● │ \n"
"│ ● ● │ \n"
"└─────────┘ \n"
,
}
If you need help with any coding please do not hesitate to reach out to me or sign up for a mentor session at my website!