First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 7 years ago

j.c. gravatar image

p.variables() returns a tuple which contains the variables of p, so your function could be written:

def f(q):
   return q*q.variables()[0]