This is a random code which is similar to my own project code. When i run it it says UnboundLocalError: local variable 'score' referenced before assignment. Can anyone fix it.
score = 0
def Random_Thing():
Random_Text = input("Random Text")
if Random_Text == "Hello":
score = score + 1
print(score)
def Random_Thing_2():
Random_Text_2 = input("Random Text 2")
if Random_Text_2 == "Hello2":
score = score + 1
print(score)
Random_Thing()
Random_Thing_2()
print(score)