fork download
  1. #!/usr/bin/env python3
  2. from sympy import *
  3.  
  4. x = [f'x{x}'for x in range(3)]
  5.  
  6. a = Matrix(x)
  7. b = Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
  8. c = expand(a.dot(b * a))
  9.  
  10. if __name__ == '__main__':
  11. print([diff(c, i).subs(list(zip(x, range(1, 4)))) for i in x])
  12.  
Runtime error #stdin #stdout #stderr 0.13s 26176KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 2, in <module>
ModuleNotFoundError: No module named 'sympy'