mydic ={'A':100,'B':200}
mydic
{'A': 100, 'B': 200}
mydic['C']=300
mydic
{'A': 100, 'B': 200, 'C': 300}
for key in mydic:
print("{}:{}".format(key,mydic[key]))
A:100
B:200
C:300
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact
def f(x):
print(x)
f(3)
3
f("hi")
hi
Interact的用法(函數,變數=起始值)
interact(f,x=3)
interactive(children=(IntSlider(value=3, description='x', max=9, min=-3), Output()), _dom_classes=('widget-int…
<function __main__.f(x)>