Created
August 13, 2015 01:19
-
-
Save tomoh1r/eca346dad30eaa8ff356 to your computer and use it in GitHub Desktop.
Python で辞書を作る
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> timeit.timeit('{x: x for x in range(10000)}', number=1000) | |
0.5202829837799072 | |
>>> timeit.timeit('dict((x, x) for x in range(10000))', number=1000) | |
1.0116031169891357 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment