In Python, I want to prevent my local variable to be hoisted to the parent scope. Basically, I want to avoid accidental programming errors by keeping the variable b's scope local to the 'if' block. Is it possible in Python. How?
a = 10
if a == 10:
b = 5
else:
c = 0
print b
# prints 5