Jolly
Jolly

Reputation: 7

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.

Upvotes: 0

Views: 39

Answers (1)

Julien
Julien

Reputation: 15206

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".

Upvotes: 1

Related Questions