# Using expression in output cell from Jupyter 

**URL:** <https://discourse.julialang.org/t/using-expression-in-output-cell-from-jupyter/22877>\
**Category:** General Usage\
**Created:** [April 7, 2019, 2:54pm UTC](https://discourse.julialang.org/t/using-expression-in-output-cell-from-jupyter/22877 "2019-04-07T14:54:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitry\_Makarov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmitry_makarov/32/7845_2.png) [@Dmitry\_Makarov](https://discourse.julialang.org/u/Dmitry_Makarov)\
**Post date:** [April 7, 2019, 2:54pm UTC](https://discourse.julialang.org/t/using-expression-in-output-cell-from-jupyter/22877/1 "2019-04-07T14:54:39Z")

</div>

Hi,  
Using Sympy, I solved a parametric equation in Jupyter and got output cell of the form: { (a+b)/c }

This is just an intermediate step, and I’d like to use this formula in subsequent input cells. But I am unable to copy it in the clipboad, nor assign it to some variable.

Of course, mine expression is much more bulky than above, so it’s defeats the purpose if I type it manually.

Would be grateful for any help.

---

<div class="post-metadata">

**Author:** ![maxmouchet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxmouchet/32/7834_2.png) [@maxmouchet](https://discourse.julialang.org/u/maxmouchet)\
**Post date:** [April 7, 2019, 3:39pm UTC](https://discourse.julialang.org/t/using-expression-in-output-cell-from-jupyter/22877/2 "2019-04-07T15:39:27Z")

</div>

You can use `ans` to get the last computed value in an interactive session (such as Jupyter/IJulia).

That said, why can’t you assign your sympy call to a variable ?

---

<div class="post-metadata">

**Author:** ![Dmitry\_Makarov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmitry_makarov/32/7845_2.png) [@Dmitry\_Makarov](https://discourse.julialang.org/u/Dmitry_Makarov)\
**Post date:** [April 7, 2019, 5:08pm UTC](https://discourse.julialang.org/t/using-expression-in-output-cell-from-jupyter/22877/3 "2019-04-07T17:08:30Z")

</div>

I can type ans in Input Cell in Jupyter notebook, and that indeed gives me the last expression.

But if I try putting smth like “ans+a” or “ans^2” in an input cell, I got an extremely long error message - please

 ![21](https://global.discourse-cdn.com/julialang/original/3X/f/0/f06ab326d665fb8679df3456341ae24e2743ea6d.png) see attached screenshot

---

<div class="post-metadata">

**Author:** ![j\_verzani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j_verzani/32/8551_2.png) [@j\_verzani](https://discourse.julialang.org/u/j_verzani)\
**Post date:** [April 7, 2019, 6:12pm UTC](https://discourse.julialang.org/t/using-expression-in-output-cell-from-jupyter/22877/4 "2019-04-07T18:12:45Z")

</div>

That is a set. Try collecting the elements before manipulating. I think “elements” should work.
