import timeit
def list_comprehension():
"""comprehension"""
l = [i for i in range(10_000)]
def list_range():
"""list range"""
l = list(range(10_000))
expSize = 1000
time1 = timeit.timeit(list_comprehension, number=expSize)
time2 = timeit.timeit(list_range, number=expSize)
print("list_comprehension() execution result time", time1)
print("list_range() execution result time", time2)
print("list_comprehension() time divided by func2 time", time1/time2)
time1 = timeit.repeat(list_comprehension, number=expSize, repeat=3)
time2 = timeit.repeat(list_range, number=expSize, repeat=3)
print("list_comprehension() execution result time", time1)
print("list_range() execution result time", time2)
print("-".join(str(n) for n in range(100)))
range_str_joined_time = timeit.timeit('"-".join(str(n) for n in range(100))', number=10000)
print(range_str_joined_time)