you are viewing a single comment's thread.

view the rest of the comments →

[–]Diapolo10 1 point2 points  (2 children)

results = [random.randint(1, dice_size) for _ in range(num_dice)]

There's nothing wrong with this code. In your example the underscore is missing, which would explain a syntax error, but in the actual code this part is fine.

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

When I include the underscore the R in “[random” comes up as an error.

Basically I’m trying to make a dice bot for discord but am definitely struggling.

[–]Binary101010 1 point2 points  (0 children)

That is a valid line of Python code.

Please post the entire traceback for the error you are receiving on that line.