Skip to content

Instantly share code, notes, and snippets.

@adamkewley
Created November 19, 2023 18:05
Show Gist options
  • Save adamkewley/60fc760062f8fc84be1040ec00c23e2f to your computer and use it in GitHub Desktop.
Save adamkewley/60fc760062f8fc84be1040ec00c23e2f to your computer and use it in GitHub Desktop.
def f(n):
result = 0
for i in range(n):
result += i * i
return result
def slow_function():
result1 = f(100000)
result2 = ''
for i in range(10000):
result2 += str(i)
result3 = sum([i for i in range(1000000)])
result4 = 0
for i in range(10000000):
result4 += len(str(i))
if __name__ == "__main__":
slow_function()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment