ich diesen Code in Python 3,5Kann jemand diesen Code ohne Fehler neu schreiben
temp=0
def add1(x):
f=12
if temp < x:
for i in range(20):
temp=temp + f
print(temp)
add1(21)
Traceback (most recent call last): File "<pyshell#29>", line 1, in
<module>
add1(12) File "<pyshell#28>", line 3, in add1
if temp < x: UnboundLocalError: local variable 'temp' referenced before assignment