Skip to content

Instantly share code, notes, and snippets.

@mcihad
Created August 29, 2018 19:04
Show Gist options
  • Save mcihad/b12c07d4e442c7e99ba923bf8002cf2c to your computer and use it in GitHub Desktop.
Save mcihad/b12c07d4e442c7e99ba923bf8002cf2c to your computer and use it in GitHub Desktop.
Python String Birleştirme
def f1(n):
import time
start=time.time()
a = ["Hi there "]
for i in range(n):
a.append(f"({i},{i}),")
s="".join(a)
end=time.time()
print(f"{n} adet deneme -> {end-start}")
return s
if __name__=="__main__":
f1(100000)
f1(1000000)
f1(10000000)
#100000 adet deneme -> 0.055971384048461914
#1000000 adet deneme -> 0.5546951293945312
#10000000 adet deneme -> 5.642395734786987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment