Ask Your Question

Pérez Broon's profile - activity

2020-07-30 17:56:40 +0100 received badge ● Notable Question (source)
2020-07-16 18:37:44 +0100 received badge ● Popular Question (source)
2020-07-12 22:21:16 +0100 received badge ● Student (source)
2020-07-12 01:48:31 +0100 asked a question Make program act on itself by entering certain areas of code (as a string) which it must itself execute

My program must act on itself by entering certain areas of code (in the form of a string) which it must itself execute.

Take the ring K of polynomials with four unknowns x_00, x_10, x_01 and x_11.

K.<x_00, x_10, x_01, x_11> = QQ []
g = K.random_element()
for i in range(1):
    for j in range(1):
         2 + g.monomial_coefficient(x_ij)

The last command tries to add to 2 the coefficient of the monomial x_ij. This is where it blocks.