Feb-05-2017, 06:14 PM
Sorry for not using the correct python terminology I'm new to this.
Every time I run this code
Every time I run this code
x=0 def phone(): if brand =='yes': x=x+1 def other(): if x==1: print('it work') brand = input('try this') print(brand) print(x) phone()It does this when the input is yes
Error:Traceback (most recent call last):
File "E:\HT\computing\practical\task 3 course work\test\test.py", line 21, in <module>
phone()
File "E:\HT\computing\practical\task 3 course work\test\test.py", line 12, in phone
x=x+1
UnboundLocalError: local variable 'x' referenced before assignment