Oct-16-2016, 11:05 AM
The bracket means there is a tuple in that position of the list.
From your code it seems that the function computeGrade() returns this tuple, but this function is not shown in your code, neither is getLastname() or getFirstname().
You can use this function from the python documentation in itertools reciepe to flatten the list.
From your code it seems that the function computeGrade() returns this tuple, but this function is not shown in your code, neither is getLastname() or getFirstname().
You can use this function from the python documentation in itertools reciepe to flatten the list.
from itertools import chain my_list = ['1', 'r', (2, '5')] def flatten(listOfLists): "Flatten one level of nesting" return chain.from_iterable(listOfLists) my_flattened_list = list(flatten(my_list)) print(my_flattened_list)
Output:['1', 'r', 2, '5']