notebook
notebook copied to clipboard
Entering numbers in output automatically changes the code cell to markdown and kernel hangs
Description
I installed the latest version of anaconda (version 24.5.0) and launched the Jupyter Notebook. I created my own environment which had the default python packages.
!jupyter --version
Selected Jupyter core packages... IPython : 8.25.0 ipykernel : 6.28.0 ipywidgets : not installed jupyter_client : 8.6.0 jupyter_core : 5.7.2 jupyter_server : 2.14.1 jupyterlab : 4.2.2 nbclient : 0.8.0 nbconvert : 7.10.0 nbformat : 5.9.2 notebook : 7.0.8 qtconsole : not installed traitlets : 5.14.3
Steps to reproduce the issue
- For example, I tried the below code with the cell type selected as 'Code'
import calendar
year = int(input("Enter the year: ")) month = int(input("Enter the month: "))
cal = calendar.month(year,month) print (cal)
- Click on the Run button in the notebook.
- The output prompt shows "Enter the year: [
- The moment I type 2, the cell automatically changes from Code to Markdown. It adds 2 hashes at the begining of the code.
After this unexpected cell type switch, the kernel runs in a continous loop. It has to be restarted by clearing all outputs. The cell type has to be manually changed from 'Markdown' to 'Code' to make changes.
Expected behavior
Ideally, the cell should have remained in 'Code' and accepted the input for 'year' and proceeded to the next input 'month'.