Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

unpack list python

def print_items(item1, item2, item3, item4, item5, item6):
  print(item1, item2, item3, item4, item5, item6)

fruit = ["apple", "banana", "orange", "pineapple", "watermelon", "kiwi"]

# deconstructs/unpacks the "fruit" list into individual values
my_function(*fruit)
Source by www.pythontutorial.net #
 
PREVIOUS NEXT
Tagged: #unpack #list #python
ADD COMMENT
Topic
Name
2+4 =