Assigning Values to Multiple Variables

In python, assigning values to several variables can be done in a compact way using list manipulation.

x1 = np.zeros(30)
v1, w1, u1 = np.split(x1,3)[:3]
print v1, w1, u1


Published: by ;

Table of Contents

Current Ref:

• til/programming/python/python-assigning-values-to-multiple-variables.md