if you type and run this program you should get = at the new thing here is the while loop only the loop (note colon and indentationwill run as long as the boolean expression [ evaluates to true note that the programmer introduced variable (the loop indexby the name iinitialized it ( before the loopand updated it ( + in the loop so for each iterationi is explicitly increased by allowing check of successive elements in the array compared to for loopthe programmer does not have to specify the number of iterations when coding while loop it simply runs until the boolean expression becomes false thusa loop index (as we have in for loopis not required furthermoreif loop index is used in while loopit is not increased automaticallyit must be done explicitly by the programmer of coursejust as in for loops and if blocksthere might be (arbitrarilymany code lines in while loop any for loop may also be implemented as while loopbut while loops are more general so not all of them can be expressed as for loop problem to be aware ofis what is usually referred to as an infinite loop in those unintentional (erroneouscasesthe boolean expression of the while test never evaluates to falseand the program can not escape the loop this is one of the most frequent errors you will experience as beginning programmer if you accidentally enter an infinite loop and the program just hangs foreverpress ctrl+ to stop the program lists and tuples alternatives to arrays we have seen that group of numbers may be stored in an array that we may treat as wholeor element by element in pythonthere is another way of organizing data that actually is much usedat least in non-numerical contextsand that is construction called list list is quite similar to an array in many waysbut there are pros and cons to consider for examplethe number of elements in list is allowed to changewhereas arrays have fixed length that must be known at the time of memory allocation elements in list can be of different typei you may mix integersfloats and stringswhereas elements in an array must be of the same type in generallists provide more flexibility than do arrays on the other handarrays give faster computations than listsmaking arrays the prime choice unless the flexibility of lists is needed arrays also require less memory use and there is lot of ready-made code for various mathematical operations vectorization requires arrays to be used the range(function that we used above in our for loop actually returns list if you for example write range( at the prompt in ipythonyou get [ in returni list with numbers in for loopthe line for in range[ makes take on each of the numbers in turnas we saw above writinge range( )gives list by the name xcontaining those five numbers these numbers may now be accessed ( as [ ]which contains the number and used in computations just as we saw for array elements as with arraysindices run from to when is the number of elements in list you may convert list to an array by array(