as mentioned earliera for loop can step across any kind of sequence object in our first examplefor instancewe'll assign the name to each of the three items in list in turnfrom left to rightand the print statement will be executed for each inside the print statement (the loop body)the name refers to the current item in the listfor in ["spam""eggs""ham"]print(xend='spam eggs ham the next two examples compute the sum and product of all the items in list later in this and later in the book we'll meet tools that apply operations such as and to items in list automaticallybut it' often just as easy to use forsum for in [ ]sum sum sum prod for item in [ ]prod *item prod other data types any sequence works in foras it' generic tool for examplefor loops work on strings and tupless "lumberjackt ("and"" ' ""okay"for in sprint(xend=' iterate over string for in tprint(xend='and ' okay iterate over tuple in factas we'll learn in the next when we explore the notion of "iterables,for loops can even work on some objects that are not sequences--files and dictionaries worktoo tuple assignment in for loops if you're iterating through sequence of tuplesthe loop target itself can actually be tuple of targets this is just another case of the tuple-unpacking assignment we studied while and for loops