this example also illustrates tuple unpacking the first line inside the function unpacks the stock parameter into four different variables the tuple has to be exactly the same length as the number of variablesor it will raise an exception we can also see an example of tuple unpacking on the last linewhere the tuple returned inside the function is unpacked into two valuesmid_value and date grantedthis is strange thing to dosince we supplied the date to the function in the first placebut it gave us chance to see unpacking at work unpacking is very useful feature in python we can group variables together to make storing and passing them around simplerbut the moment we need to access all of themwe can unpack them into separate variables of coursesometimes we only need access to one of the variables in the tuple we can use the same syntax that we use for other sequence types (lists and stringsfor exampleto access an individual valuestock "fb" high stock[ high we can even use slice notation to extract larger pieces of tuplesstock[ : ( these exampleswhile illustrating how flexible tuples can bealso demonstrate one of their major disadvantagesreadability how does someone reading this code know what is in the second position of specific tuplethey can guessfrom the name of the variable we assigned it tothat it is high of some sortbut if we had just accessed the tuple value in calculation without assigning itthere would be no such indication they would have to paw through the code to find where the tuple was declared before they could discover what it does accessing tuple members directly is fine in some circumstancesbut don' make habit of it such so-called "magic numbers(numbers that seem to come out of thin air with no apparent meaning within the codeare the source of many coding errors and lead to hours of frustrated debugging try to use tuples only when you know that all the values are going to be useful at once and it' normally going to be unpacked when it is accessed if you have to access member directly or using slice and the purpose of that value is not immediately obviousat least include comment explaining where it came from