How can I execute the code line by line in jupyter-notebook? : <p>I'm reading the book, <code>Python Machine Learning</code>, and tried to analyze the code. But it offers only <code>*.ipynb</code> file and it makes me very bothersome.</p>

<p>For example, </p>

<p><a href="https://i.stack.imgur.com/VVzTb.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VVzTb.png" alt="enter image description here"></a></p>

<p>In this code, I don't want to run whole <code>In[9]</code> but want to run line by line so that I can check each value of variable and know what each library function do. </p>

<p>Do I have to comment everytime I want to execute part of codes? I just want something like <code>Execute the block part</code> like in <code>MATLAB</code></p>

<p>And also, let say I comment some part of code and execute line by line. How can I check each variable's value without using <code>print()</code> or <code>display()</code>? As you know, I don't have to use <code>print()</code> to check the value in <code>python interactive shell</code> in terminal. Is there a similar way in <code>Jupyter</code>?</p>
