in earlier versions of the accumulation loopwe needed an assignment statement to change the object doing the accumulatingbut now the method append modifies its list automaticallyso we do not need an assignment statement read and try the example program multiply pydef multiplyall(numlistmultiplier)# '''return new list containing all of the elements of numlisteach multiplied by multiplier for exampleprint(multiplyall([ ] )[ ''newlist list(for num in numlistnewlist append(num*multiplierreturn newlist print(multiplyall([ ] )# # # # # make sure the result makes sense to you or follow the details of playing computer below line - numlist [ [ [ [ [ [ [ [ [ [ multiplier newlist [[[ [ [ [ [ [ [ num comment definition call function set formal parameters first in list append * next in list append * last in list append * done with list and loop return [ print [ using for-loop and append is powerful and flexible way to derive new listbut not the only way sets list may contain duplicatesas in [ this is sometimes usefuland sometimes not you may have learned in math class that set is collection that does not allow repetitions ( set automatically removes repetitions suggestedpython has type set like many type namesit can be used to convert other types in this case it makes sense to convert any collectionand the process removes duplicates read and see what happensstrlist [' ''zz'' '' ''bb'' '' '' 'aset set(strlistaset {'bb''zz'' '' '' '(technicallya set is unorderedso your version of idle may list the set in different order set literals are enclosed in braces like other collectionsa set can be used as sequence in for loop readand check it makes sensefor in asetprint( more classes and methods