Ipython Notebook Widget displays 'None' (the return value)
Question: I have the following (example) code to display a widget and update a value
based on the widget. It works fine, except in my Ipython notebook, None is
displayed at the end (which is what was returned from my function). How do I
hide that/ return something that won't be displayed?

    
    
    from ipywidgets import widgets, interact, interactive
    from IPython.display import display, clear_output
    
    opts = 'dog'
    def update_val(a):
        ValuesWidget.options = [a]
    
    ArrayWidget = interactive(update_val,a=widgets.Dropdown(description="Pick an animal: ",options=['dog','cat','mouse']))
    ValuesWidget = widgets.Dropdown(description="Display this value: ",options=[opts])
    display(ArrayWidget,ValuesWidget)
    

If I do a 'return 5' at the end of the function five is displayed instead, so
I know the issue is with the return value of the function.


Answer: In the code you're posting, you aren't returning anything so it's returning
`None` by default. Try using:

    
    
    return ValuesWidget.options = [a]
    

