notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Entering numbers in output automatically changes the code cell to markdown and kernel hangs

Open vinoth137 opened this issue 1 year ago • 0 comments
trafficstars

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

  1. 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)

image

  1. Click on the Run button in the notebook.
  2. The output prompt shows "Enter the year: [

image

  1. The moment I type 2, the cell automatically changes from Code to Markdown. It adds 2 hashes at the begining of the code.

image

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

vinoth137 avatar Jun 29 '24 21:06 vinoth137