0

I am using jupyte notebook

This is the Code

from ipywidgets import interact

define a function to work with (cubes the number)

def myfunction(arg): return arg+1 interact(myfunction, arg=9);

The result showing is 10 instead it should be showing a slider

Showing: enter image description here

Instead it show: enter image description here

1 Answers1

0

I can't tell exactly what went wrong with what you did because there are formatting issues with your post -- you need to indent the code 4 spaces when you ask the question to make it look right, which effects the meaning because Python is sensitive to white space.

I modified your text and got it to work for me

from ipywidgets import interact

def myfunction(arg): 
    return arg+1 

interact(myfunction, arg=9)

Screenshot:

enter image description here

Aaron Watters
  • 2,784
  • 3
  • 23
  • 37