the sequence of next( )and list(agives exactly the same results as the comprehension in section it is straightforward to write version of the built-in enumerate let' call it myenumeratepythondemo py -(continued def myenumerate(enum)for in range(len(enum))yield ,enum[iexercise write version of enumerate where the only iteration is "for val in enumhintkeep track of the index useful libraries timing code in order to compare algorithmswe often want to compute how long program takesthis is called the runtime of the program the most straightforward way to compute runtime is to use time perf counter()as inimport time start_time time perf_counter(compute_for_a_while(end_time time perf_counter(print("time:"end_time start_time"seconds"note that time perf_counter(measures clock timeso this should be done without user interaction between the calls on the consoleyou should dostart_time time perf_counter()compute_for_a_while()end_time time perf_counter(if this time is very small (say less than second)it is probably very inaccurateand it may be better to run your code many times to get more accurate count for this you can use timeit (timeit htmlto use timeit to time the call to foo bar(aaauseimport timeit time timeit timeit("foo bar(aaa)"setup="from __main__ import foo,aaa"number= the setup is needed so that python can find the meaning of the names in the string that is called this returns the number of seconds to execute foo bar(aaa times the variable number should be set so that the runtime is at least seconds you should not trust single measurement as that can be confounded by interference from other processes timeit repeat can be used for running timit few (say times usually the minimum time is the one to reportbut you should be explicit and explain what you are reporting version june