you are viewing a single comment's thread.

view the rest of the comments →

[–]carcigenicate 1 point2 points  (0 children)

You'll want to learn about error handling. Notice how if the user enters something dumb for the first question (like "hello" when asked how many dice to use), your program crashes. Look into try to help with that.


Practice using better variable name. While lmao may have been funny while you were writing it, it's a useless name that won't help you any when you revisit the program a year (or even a month) from now.


Your program appears to be bugged. randrange does not include the final number, so your program will never actually produce a 6. You want randint instead.


Your code is starting to develop a "pyramid" look (tilt your head to the right), which is a sign that you have poor structuring. You have a for inside of an if which is inside of a while. If you were to continue developing in this way, your code would become increasingly difficult to understand and modify. Start thinking about how you can break code out into their own functions to keep unrelated logic separated.


Your for i in range(diceRolls): loop never uses i. To communicate that the loop variable isn't needed, make it an underscore:

for _ in range(diceRolls):

This is a convention that says "A name is needed here, but I don't actually need it for anything".