Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to append a tuple to a list

a_list = []
a_list.append((1, 2))       # Succeed! Tuple (1, 2) is appended to a_list
a_list.append(tuple(3, 4))  # Error message: ValueError: expecting Array or iterable
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #append #tuple #list
ADD COMMENT
Topic
Name
7+3 =