Ask Your Question

Revision history [back]

There are at least 4 problems with your code: - if you want polynomials, you need to declare x as a variable of a polynomial ring over K - the syntax "f(x) = something" is only intended for symbolic functions, in your case you should just use standard affectation "f = something" - implicit multiplication does not work A[i]x is an error you should write A[i]*x - the syntax of the for loop is wrong

Here is a corrected version

K.<a>=GF(2^3)
x = polygen(K)
for ai in K:
    for aj in K:
        f = x^2 + ai*x + aj
        print f

There are at least 4 problems with your code: - code:

  • if you want polynomials, you need to declare x as a variable of a polynomial ring over K - K
  • the syntax "f(x) = something" is only intended for symbolic functions, in your case you should just use standard affectation "f = something" - something"
  • implicit multiplication does not work A[i]x is an error you should write A[i]*x - A[i]*x
  • the syntax of the for loop is wrong

Here is a corrected version

K.<a>=GF(2^3)
x = polygen(K)
for ai in K:
    for aj in K:
        f = x^2 + ai*x + aj
        print f

There are at least 4 problems with your code:

  • if you want polynomials, you need to declare x as a variable of a polynomial ring over K
  • the syntax "f(x) = something" is only intended for symbolic functions, in your case you should just use standard affectation "f = something"
  • implicit multiplication does not work A[i]x is an error you should write A[i]*x
  • the syntax of the for loop is wrong

Here is a corrected version

K.<a>=GF(2^3)
K.<a> = GF(2^3)
x = polygen(K)
for ai in K:
    for aj in K:
        f = x^2 + ai*x + aj
        print f