Below is my sum program in Python.
import time
start_time = time.time()
sum = 0
for num in range(0,10000001):
sum = sum + num
print(sum)
print("--- %s seconds ---" %.2f (time.time() - start_time))
Output:
50000005000000
--- 6.02535605430603 seconds ---
The question is how to get the output up to 2 decimal points.