Number Guess Project need help debugging


The error message that shows is

Traceback (most recent call last):
File “”, line 38, in
File “”, line 34, in roll_dice
if user_guess > total_roll:
UnboundLocalError: local variable ‘total_roll’ refer
enced before assignment


Be sure the variable is defined before referencing. It is currently being defined in the the else branch, and does not exist outside of that.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.