Skip to content

Instantly share code, notes, and snippets.

@hannesstruss
Created November 1, 2012 09:20
Show Gist options
  • Save hannesstruss/3992673 to your computer and use it in GitHub Desktop.
Save hannesstruss/3992673 to your computer and use it in GitHub Desktop.
Python String concat
In [11]: timeit.timeit("""
....: a = "asd"
....: b = "dsa"
....: a + b""", number=10**8)
Out[11]: 8.79588794708252
In [12]: timeit.timeit("""
....: a = "asd"
....: b = "dsa"
....: "%s%s" % (a, b)""", number=10**8)
Out[12]: 16.322087049484253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment