1

I was using Sympy in Jupyter where I realized I cant display two things in the same line with display() command. I know how to do it with print() but since I am using Sympy I need to also do it with display(). Can someone help me please? Thank you!

The code:

display('Value =', smp.Symbol('\Gamma_{\mu\nu}^{\lambda}'))
wjandrea
  • 28,235
  • 9
  • 60
  • 81
Abdullah
  • 17
  • 1
  • 6
  • Related: [IPython Notebook: how to display() multiple objects without newline](/q/17439176/4518341) - This is for strings, but I'm sure there'll be a better solution for SymPy specifically. – wjandrea Aug 15 '22 at 17:58
  • @wjandrea thank you however I was going to display one string and one symbolic value together. Here it is: `display('Value =', smp.Symbol('\Gamma_{\mu\nu}^{\lambda}'))` – Abdullah Aug 15 '22 at 18:40
  • What if you made the string symbolic too? `display(smp.Eq(smp.Symbol('Value'), smp.Symbol(...)))` – wjandrea Aug 16 '22 at 19:54

1 Answers1

1

For your problem, you may use "Eq":

   value, gm, lam = symbols('Value, Gamma_mu_nu ,lambda')
   Eq(value,gm**lam)

Value=gamma_mu_nu^lambda latex display

2diabolos.com
  • 992
  • 9
  • 15