A tuple is an unchangeable sequence of values.<\/p>\n
x=(“Gilberto”,18,”ISC”) \u00a0 #A<\/a> tuple is written with ()<\/p>\n When you do this you create a tuple with three elements. You can access these elements individually by typing the variable and the then inside brackets directly to the right of the variable type the number of the element to which you are referring.<\/span><\/p>\n print (x[o])<\/span><\/p>\n >>>Gilberto<\/span><\/p>\n Python starts numbering at 0 so Gilberto=0,18=1 and ISC = 2<\/span><\/p>\n Packing and Unpacking:<\/span><\/span><\/strong><\/p>\n In tuple packing, the values on the left are \u2018packed\u2019 together in a tuple:<\/span><\/p>\n x=(“Gilberto”,18,”ISC”)<\/p>\n In tuple unpacking, the values in a tuple on the right are \u2018unpacked\u2019 into the variables\/names on the right:<\/span><\/p>\n x=(“Gilberto”,18,”ISC”)<\/p>\n (Name,Age,Studies) = x<\/p>\n print(Name,Age,Studies)<\/p>\n >>>Gilberto 18 ISC<\/p>\n Sources for info. about tuples:\u00a0Link<\/a><\/p>\n \u00a0<\/p>\n #TC<\/a>1014<\/p>\n #MASTERY<\/a>24<\/p>\n Gilberto Rogel Garc\u00eda<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":" A tuple is an unchangeable sequence of values.<\/p>\n x=(“Gilberto”,18,”ISC”) #A<\/a> tuple is written with ()<\/p>\n When you do this you create a tuple with three elements. You can access these elements individually by typing the variable and the then inside brackets directly to the right of the variable type the number of the element to which you are referring.<\/span><\/p>\n print (x[o])<\/span><\/p>\n >>>Gilberto<\/span><\/p>\n Python starts numbering at 0 so Gilberto=0,18=1 and ISC = 2<\/span><\/p>\n Packing and Unpacking:<\/span><\/span><\/strong><\/p>\n In tuple packing, the values on the left are ‘packed’ together in a tuple:<\/span><\/p>\n x=(“Gilberto”,18,”ISC”)<\/p>\n In tuple unpacking, the values in a tuple on the right are ‘unpacked’ into the variables\/names on the right:<\/span><\/p>\n x=(“Gilberto”,18,”ISC”)<\/p>\n (Name,Age,Studies) = x<\/p>\n print(Name,Age,Studies)<\/p>\n >>>Gilberto 18 ISC<\/p>\n Sources for info. about tuples: Link<\/a><\/p>\n <\/p>\n #TC<\/a>1014<\/p>\n