Error in for loop. (Finding three integers)
Question: So, our teacher gave us an assignment to find three integers a, b c. They are
in all between 0 and 450 using Python.

a = c + 11 if b is even  
a = 2c-129 if b is odd

b = ac mod 2377

c = (∑(b-7k) from k = 0 too a-1) +142 (Edited. I wrote it wrong. Was -149)

I tired my code that looks like this: (Still a newbie. I guess a lot of my
code is wrong)

    
    
    for a, b, c in range(0, 450):
        if b % 2 == 0:
            a = c + 11
        else:
            a = 2 * c - 129
        b = (a * c) % 2377
        c = sum(b - 7 * k for k in range(0, a - 1))
    

but I get the error:

    
    
    for a, b, c in range(0, 450):
    TypeError: 'int' object is not iterable
    

What am I doing wrong and how can I make it check every number between 0 and
450?


Answer: 
    import itertools
    
    for b, c in itertools.product(*[range(450)]*2):
        if b % 2 == 0:
            a = c + 11
        else:
            a = 2 * c - 129
        derived_b = (a * c) % 2377
        derived_c = sum(b - 7 * k for k in range(0, a - 1))
    
        if derived_b == b and derived_c == c:
            print a, b, c
    

