Error in Exercise 3 W4

There is an error “UnboundLocalError: local variable ‘p1’ referenced before assignment” in Exercise.3 which is die to exercise 1,I suppose but I can’t figure out the issue. I am achieving the results but this error is appearing in every solution .Please let me know how I can correct it?
Thanks in advance!

There is an error in your compute_entropy() code. You can’t test the p1 variable in that if-statement (at line 26) unless you already gave it a value earlier in the function.

Thank you so much! Problem solved. I forgot to indent if-statement properly.