I'm new to python and was working on a simple password cracker for practice with lists and dictionaries. Half way thru my test program I ran into this error.
PS E:\python_projects> python test.py
File "test.py", line 9
global counter += 1
^
SyntaxError: invalid syntax
Here is the code...
maxChar = 4
counter = 0
alph = ['A','B','C','D','E','F','G']
passCheck = []
password = 'f'
password = str(password.lower())
def loopTest():
global counter += 1
if counter <= maxChar:
loopTest() #Nests loops
else:
for letter in alph: #scans letters
passCheck[0] = letter
if passCheck == password: #checks password
print 'found password: ' + passCheck
else:
print passCheck
loopTest()
print 'Debug.'
print counter
there may be other errors and that's fine but I don't understand why I'm getting hung up on a += that I thought I understood, anyway thanks for looking!