Number Guess Project need help debugging


#1

The error message that shows is

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


#2

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.


#3

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