Search code examples
google-colaboratoryuser-experience

How to delete a form from a cell in a Google Colab notebook?


I might be going crazy, but I believe I read all the existing documentation on Google Colab and I couldn't figure this one out. Maybe it's not possible, but I find this to be very weird.

I am aware that the form can be hidden, and that I can simply copy paste the contents of the cell and just paste it in a new cell that doesn't have a form, but these are hacks and not how a regular user would try to do it.

I am wondering if I'm going crazy and I just can't see the delete form button, or did someone at google colab UX simply forgot about the delete form menu? (or maybe they chose to not add it for a reason I can't understand)


Solution

  • You specify the form with #@param. Forms are simply interpretable Python comments.

    For example

    i = 0 #@param {type:'slider', max: 10}
    

    To remove the form, just remove all #@param, including the initial #@title

    i = 0 
    

    The "Add a form" menu simply inserts the #@title parameter. There is no menu to remove this line.