basic constructions is then used (combined with the starting at thuscalling rangefor exampleas range( would return the integers note that decreasing integers may be produced by letting start stop combined with negative step this makes it easy toe traverse arrays in either direction let us modify ball_plot py from sect to illustrate how useful for loops are if you need to traverse arrays in that example we computed the height of the ball at every milli-second during the first second of its (verticalflight and plotted the height versus time assume we want to find the maximum height during that timehow can we do it with computer programone alternative may be to compute all the thousand heightsstore them in an arrayand then run through the array to pick out the maximum the programnamed ball_max_height pymay look as follows import matplotlib pyplot as plt linspace( * * * ** initial velocity acceleration of gravity points in time interval generate all heights at this pointthe array with all the heights is ready now we need to find the largest value within largest_height [ for in range( )if [ilargest_heightlargest_height [istarting value for search print "the largest height achieved was % (largest_heightwe might also like to plot the path again just to compare plt plot( ,yplt xlabel('time ( )'plt ylabel('height ( )'plt show(there is nothing new hereexcept the for loop constructionso let us look at it in more detail as explained abovepython understands that for loop is desired when it sees the word for the range(function will produce integers fromand including up toand including the value in [ is used as the preliminary largest heightso thate the very first check that is made is testing whether [ is larger than this height if soy[ is stored as the largest height the for loop then updates to and continues to check [ ]and so on each time we find larger numberwe store it when finishedlargest_height