0
help with a D&D 5e stat generator in python
I have the code to create a single stat and I could just copy and paste that code and change the variables but I know there has to be a better way to do it. basically what I have now is: create a list, call a function to generate 4 numbers between 1 and 6 and then add them to the list, then remove the smallest number and add the list together. how could I loop this to run 5 more times? here is a link to the code on the code playground https://code.sololearn.com/ccWluc8EK24N/#py hope that link works
2 Answers
+ 1
It will be hard to code the last bit in Sololearn, but to achieve it you would have to get user input for each stat using the list of rolls as possible choices. I would use an actual generator and "yield" each key asking the user for an update. I hope this helps.
https://code.sololearn.com/c8js7DMisH02/?ref=app
0
Steven M thank you that helps a lot