#TC1014<\/a> #Mastery24<\/a><\/p>\n In this mastery I will talk about tuples.A tuple is a sequence of immutable Python objects, is like lists, but they have on especially diference, that ones yu create a tuple you can not modify but in lits you can. Also the sintax of tuples are parentheses and lists use square brackets.for example:<\/p>\n tuple1=(“efrain”,”duarte”,”lopez”,20)<\/p>\n you can write strings,numbers is just like lists.<\/p>\n be careful when you just write one thing inside a tuple you have to write it like this:<\/p>\n tuple2=(“ice”,) ——> such is just one thing you have to add a comma to the end<\/p>\n To acces values in tuples you have to use square brackets.for example:<\/p>\n tuple1=(“efrain”,”duarte”,”lopez”,20)<\/p>\n print tuple[0]——–>the result will be “efrain”<\/p>\n print tuple[0:2]—–>the result will be [“efrain”,”duarte”,”lopez”]<\/p>\n this is counting beging form 0.<\/p>\n You cant modify a tuple but you can create a new tuple with other tuples like this:<\/p>\n tuple3=tuple1+tuple2<\/p>\n tuple3 will be>>>(efrain”,”duarte”,”lopez”,20,”ice”)<\/p>\n Also the tuples respond to the + and * operators much like strings, and this operations will create a new tuple not just strings .For example the basic tuples operations:<\/p>\n tuple4=(1,2,3,4)<\/p>\n print lent(tuple4)——>resutl= 4<\/p>\n also we can use Concatenation,Repetition,Iteration.<\/p>\n an important point is that we can modify a list inside a tuple, but the tuple we can n ever touch it.<\/p>\n for more information here is a link its very helpful:<\/p>\n http:\/ #TC1014 #Mastery24In this mastery I will talk about tuples.A tuple is a sequence of immutable Python objects, is like lists, but they have on especially diference, that ones yu create a tuple you can not modify but in lits you can. Also the si… Continue reading