Measuring_time
import time def sum_up_to(end): sum = 0 for number in range(1, end + 1): sum = sum + number return sum start = time.perf_counter() print(sum_up_to(125555)) end = time.perf_counter() print(end-start)
import time def sum_up_to(end): sum = 0 for number in range(1, end + 1): sum = sum + number return sum start = time.perf_counter() print(sum_up_to(125555)) end = time.perf_counter() print(end-start)