You want to measure running time of the list comprehension "[x for x in range(1, 100)]" and use timeit.repeat("[x for x in range(1, 100)]", repeat=5) to run it 5 times. You got the following list: [2.9111392999766394, 2.8440076999831945, 2.9269346999935806, 2.927129799965769, 3.08065760001773]. Which one of these values really reflects how fast your code is?
Timeit module
Interpreting the results
Report a typo
Select one option from the list
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.