counter not inceasing in python
Question: I have looked at other while loops and am stuck on why this one is not
working.

    
    
    points = int(input('How many points: '))
    while True:
        u_cnt, c_cnt = 0, 0
        if u_cnt < points or c_cnt < points:
            if u < c:
                c_cnt += 1
            elif u > c:
                u_cnt += 1
    

Is my problems having the `c_cnt += 1` inside of two if statements?

I have put it outside of the `while` loop, yet that doesn't increase count
either. I have also put the `u_cnt = 0` and `c_cnt = 0` on separate lines.

It's not doing an infinite loop, as it should not do. It's just not
incrementing.

Thank you

edit:

    
    
    import random
    
    u_name = input('What is your name? ')
    points = int(input('How many points: '))
    u_cnt, c_cnt = 0, 0
    
    while True:
        a = ['rock', 'paper', 'scissors']
        comp = random.choice(a)
        print('Pick from:', str(a).strip('[]'))
        user = input()
        u = a.index(user)
        c = a.index(comp)
        line_1 = '{} : {}\t{} : {}'.format(u_name, user, 'Computer', comp)
        line_2 = '{} : {}\t{} : {}\n'.format(u_name, u_cnt, 'Computer', c_cnt)
    
        if c_cnt < points or u_cnt < points:
            if u > c or u == 0 and c == 2:
                u_cnt += 1
                print(line_1, '\t', u_name, 'wins')
                print(line_2)
            elif u < c or u == 2 and c == 0:
                c_cnt += 1
                print(line_1, '\t', 'Computer wins')
                print(line_2)
            elif u == c:
                print(line_1, '\t', 'Tie')
                print(line_2)
        else:
            break
    

so when you run this the first time, you get an answer back like

    
    
    What is your name? chad
    How many points: 3
    Pick from: 'rock', 'paper', 'scissors'
    rock
    chad : rock Computer : scissors      chad wins
    chad : 0    Computer : 0
    
    Pick from: 'rock', 'paper', 'scissors'
    

how to get the count be 1, 0 on the first iteration through. that might be a
better question.


Answer: The code have to be right there:

    
    
    points = int(input('How many points: '))
    u_cnt, c_cnt = 0, 0 # asign the values before the loop
    while True:
        if u_cnt < points or c_cnt < points:
            if u < c:
                c_cnt += 1
            elif u > c:
                u_cnt += 1
    

