d = {'A': 1, 'B': 2}
d_iterable = iter(d.keys())
a = next(d_iterable)
b = next(d_iterable)
print(a, b)
A B
d = {'A': 1, 'B': 2}
d_iterable = list(d.keys())
print(d_iterable)
['A', 'B']
a = [1, 2, 3]
def some(x):
return x**2
new_a = [some(x) for x in a]
print(new_a)
[1, 4, 9]
x = [True, False]
print(x*8)
[True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False]
x1 = x2 = 5
x1, x2 = x2, x1+x2
print(x1, x2)
x1 = x2 = 5
x1 = x2
x2 += x1
print(x1, x2)
5 10
5 10
i=0
y_list = range(50, 591, 60)
x_list = range(30, 211, 20)
for x, y in zip(x_list, y_list):
point = sd.get_point(x, y)
sd.circle(center_position=point, radius=30)
sd.pause()
base_params = {'type': 'line', 'xref':'paper', 'yref': 'y', 'line_width': 0.8, 'x0': 0, 'x1': 1, 'line_color': '#A9A9A9'}
line_params = {'line': {'dash': 'dot'}}
shapes=[
dict(y0='avc', y1='avc', **base_params),
dict(y0='mic', y1='mic', **base_params, **line_params),
dict(y0='buyd', y1='buyd', **base_params, **line_params),
dict(y0='selld', y1='selld', **base_params, **line_params),
dict(y0='buyu', y1='buyu', **base_params, **line_params),
dict(y0='sellu', y1='sellu', **base_params, **line_params),
dict(y0='mac', y1='mac', **base_params, **line_params)
]
print(shapes)