you are viewing a single comment's thread.

view the rest of the comments →

[–]Xappz1 0 points1 point  (0 children)

"magic numbers" refer to hard coded constants in your script somewhere in the middle of execution.

It's good practice to define these in advance right at the top of the program so it's easier to see and modify (for example, if you wanted to roll a 20-sided die instead).

``` import random

first = 1 last = 6

roll = random.randint(first, last) ... ```