loops and lists typeerror'tupleobject doesn' support item deletion the observant reader might wonder why the line (- - in the example above workssince is supposed to be immutable and therefore impossible to change the answer is related to the way assignment statements work in programming as briefly explained in assignment works by first evaluating the expression on the right hand sidewhich in this example means to add two tuples together the result is new tupleand neither nor (- are changed in the process thenthe new tuple is assigned to the variable tmeaning that the original tuple is replaced by the new and longer tuple the tuple itself is never changedbut the contents of the variable is replaced with new one natural question to askthenis why do we need tuples at allwhen lists can do the same job and are much more flexiblethe main reason for this is thatin many casesit is convenient to work on item that is constantsince it is protected against accidental changes and can be used as key in so-called dictionariesan important python datastructure that will be introduced in throughout this bookwe will not do much explicit programming with tuplesbut we will run into them as part of the modules we import and useso it is important to know what they are open access dieses kapitel wird unter der creative commons namensnennung international lizenz (in jeglichem medium und format erlaubtsofern sie den/die ursprunglichen autor(enund die quelle ordnungsgemass nenneneinen link zur creative commons lizenz beifugen und angebenob anderungen vorgenommen wurden die in diesem kapitel enthaltenen bilder und sonstiges drittmaterial unterliegen ebenfalls der genannten creative commons lizenzsofern sich aus der abbildungslegende nichts anderes ergibt sofern das betreffende material nicht unter der genannten creative commons lizenz steht und die betreffende handlung nicht nach gesetzlichen vorschriften erlaubt istist fur die oben aufgefuhrten weiterverwendungen des materials die einwilligung des jeweiligen rechteinhabers einzuholen