Ive got a method that use to work by checking the first three letters/numbers and making sure they are the same before it continues like so
def combineProcess(request):
carID1 = request.POST['carID1']
carID2 = request.POST['carID2']
for x in range (0,3):
a += carID1.length(x)
b += carID2.length(x)
if a.equals(b):
//do something
before it use to work now it stopped and i get this error.
Exception Type: UnboundLocalError
Exception Value:
local variable 'a' referenced before assignment
which i never use to get a few weeks ago didnt change anything so i made a and b global.
def combineProcess(request):
carID1 = request.POST['carID1']
carID2 = request.POST['carID2']
global a,b
for x in range (0,3):
a += carID1.length(x)
b += carID2.length(x)
if a.equals(b):
//do something
Now I am getting this error.
Exception Type: NameError
Exception Value:
name 'a' is not defined
Then i removed the global line and just put this
a = "P"
and got the following error
str object has no attribute length() or len()
which now has me puzzled how has this code stop working and why cant it recognize that a string object has a len() method. mainly I am lost how my code went from working to not working over a two weeks off.