Jupyter Notebook python/ Why is this being printed?



enter image description here

  1. Why is out[2] being tagged on the 2nd "Hello World"?
  2. Why is the second "Hello World" being printed? I think it should be commented out.


First Hello World is the effect of your print statement.
Out[2] (more generally Out[n]) shows the result of the 2nd (more generally nth) execution you requested. In this case the result of the last line of In [2] which is just the string "Hello World".

Answered By – Julien

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More