{"action":"opened","issue":{"url":"https://api.github.com/repos/jupyter/notebook/issues/93","labels_url":"https://api.github.com/repos/jupyter/notebook/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/notebook/issues/93/comments","events_url":"https://api.github.com/repos/jupyter/notebook/issues/93/events","html_url":"https://github.com/jupyter/notebook/issues/93","id":76726885,"number":93,"title":"Support display of assignment result (for didactic resons)","user":{"login":"cknoll","id":1315698,"avatar_url":"https://avatars.githubusercontent.com/u/1315698?v=3","gravatar_id":"","url":"https://api.github.com/users/cknoll","html_url":"https://github.com/cknoll","followers_url":"https://api.github.com/users/cknoll/followers","following_url":"https://api.github.com/users/cknoll/following{/other_user}","gists_url":"https://api.github.com/users/cknoll/gists{/gist_id}","starred_url":"https://api.github.com/users/cknoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cknoll/subscriptions","organizations_url":"https://api.github.com/users/cknoll/orgs","repos_url":"https://api.github.com/users/cknoll/repos","events_url":"https://api.github.com/users/cknoll/events{/privacy}","received_events_url":"https://api.github.com/users/cknoll/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-15T13:28:57Z","updated_at":"2015-05-15T13:28:57Z","closed_at":null,"body":"Imagine the following situation: somewhere in my notebook full of nontrivial math I want to solve an equation. I want the solution to be stored in a variable *and* I want to display the solution for better understandability of what is going on.\r\n\r\nUntil now I write in a cell:\r\n\r\n`sol = sympy.solve(eqn, var)`\r\n`sol`\r\n\r\nThis requires the extra line `sol`.\r\n\r\nIn a teaching context (especially when not much experience with the used language (e.g. Python) can be assumed) it is often useful to display many intermediate results. However this causes a big amount of 'extra lines' which consume space, typing time and potentially reduce the clarity of the document.\r\nAnd those lines contradict the programming principle \"Don repeat yourself!\".\r\n\r\nI thus suggest the following feature:\r\n\r\nIf the line contains a special comment like e.g.`#:` and an variable assignment, then the result of the assignment is displayed as output of the cell.\r\n\r\nThe example above would then read:\r\n\r\n`sol = sympy.solve(eqn, var)  #:`\r\n\r\nbut also cause the content of `sol` to be displayed.\r\n\r\nThis feature could also be extended to trigger the display of more than the last result from one cell.\r\n\r\n`sol1 = sympy.solve(eqn1, var)  #:`\r\n`sol2 = sympy.solve(eqn2, var)  #:`\r\n\r\nObviously the details are up do discussion, but I am convinced that the clarity and thus the \"didactic value\" of notebooks would benefit."}}