What is the syntax to use multiple assignment in lists?

<variable 1>, <variable2>, <variable3>...etc = <array name>

If the number of variables does not equal the length of list (how many values are in the list), a Traceback error will occur.

#example
flowers=['roses','tulips','daisies']
option1, option2, option3 = flowers

 

 

Advertisements