So I have a multilayered problem. I am trying to I am trying to just print out 'input was jack' if the raw\_input was 'jack' and also subtract 'tries' by 1, and then run the function again and print out amount of 'tries' at the end of both the first 'if' statement and the 'else' statement, and if the raw\_input wasn't 'jack' it adds 1 to 'tries' and if 'tries' reaches a total of 4 the function prints stop. I have run into a couple of different problems. Either the counter seems to reset every single time so it's always just '1' or I can't just keep running the function. It just doesn't seem like it's following the 'if or else' theory I thought it would be. So I have the following code:

```
tries = 0
def usrinfo():
    name = raw_input('input name ')
    a = ('jill','jack',name,'meg')

    for element in a:
        if element == 'jack':
            print('input was jack')
            tries =-1
            print(tries)
            usrinfo()
    else:
        if element != 'jack':
            tries =+ 1
            return tries
            print(tries)
            usrinfo()
            if tries == 4:
                print('stopped')
usrinfo()

```

If I type 'jack' I get:

```
Nothing...as in a blank output

```

I want:

```
input was jack
-1 

```

Then I want the function to run again...and get

```
input was jack
-2

```

And so on.

If I type anything other than 'jack' I get:

```
Nothing...as in a blank output

```

I want to get:

```
1

```

Then for the function to run again....and get

```
2

```

Then if I type anything other than 'jack'. I want with each attempt to print the increasing level of tries from 1 - 4 such as below:

```
1
2
3
4

```

Then when it reaches 4 it prints 'stopped' or runs whatever command. I want to essentially keep the code running and control the value of 'tries' according to whether or not the input is 'jack' or something else. Because even when I create an even simpler code like this:

```
def userinput():
    tries = 0
    username = raw_input('input username ')

    if username == 'jack':
        tries -=1
        print(username + ' '+ str(tries) + ' success')
        userinput()

    else:
        if username != 'jack':
            tries +=1
        print('tries ' + str(tries))
        userinput()
userinput()

```

My results on this code with input of 'f' are:

```
input username f
tries 1
input username f
tries 1
input username f

```

Instead I want to get:

```
input username f
tries 1
input username f
tries 2
input username f
tries 3

```

And with input of 'jack' I want:

```
input username jack
jack -1 success
input username jack
jack -2 success
input username jack
jack -3 success
input username jack
jack -4 success

```

And so on. Any help is much appreciated. I'm not sure what I'm doing wrong. It just seems like 'tries' is constantly resetting itself.

Hopefully this is clear...I've spent a lot of time trying to make code just to be able to demonstrate to someone with more knowledge where my misunderstanding might be...

Thanks guys and gals.