I knew if, for, and while statements. There seems to be a list comprehension (I don't know about dictionaries and generators) attribute? Somehow, I have a masochist attribute + a glasses girl attribute?
List comprehension http://docs.python.jp/2/tutorial/datastructures.html Example: Project Euler 29 http://qiita.com/cof/items/b39c28e8770fc60b074d
Dictionary comprehension (Python 2.6? Or later) ?? (In the sense of) Example: Project Euler 23 http://qiita.com/cof/items/3e02bca57b6a6dc1578a
List comprehension, dictionary comprehension, generator differences, notation (by shiracamus) See comments below http://qiita.com/cof/items/b39c28e8770fc60b074d
Is it possible to simplify the code by making the branch of the if statement into a dictionary? (I understand) (by shiracamus) See comments below http://qiita.com/cof/items/567dbc499fbf6d4aefb1
map () function http://docs.python.jp/2/library/functions.html#map Example: Project Euler 20 http://qiita.com/cof/items/400ae6793819850ce68a
reduce () function http://docs.python.jp/2/library/functions.html#reduce Example: Project Euler 22 http://qiita.com/cof/items/40519ba5d3d59db079de
lambda http://www.lifewithpython.com/2013/01/python-anonymous-function-lambda.html
time Especially time.time () http://docs.python.jp/2/library/time.html
timit () function http://docs.python.jp/2/library/timeit.html How to use http://qiita.com/cof/items/ddac98e31a5a4bf16ec7#comment-e9bb24a7450c6b0d74fd
file-> list Example: Project Euler 22 http://qiita.com/cof/items/40519ba5d3d59db079de
It is easy to understand if the constant is written in uppercase.
If you use range () in multiple loops, the speed tends to slow down, so it's a good idea to put it in a variable before the loop.
List comprehension is (generally) fast http://qiita.com/cof/items/ddac98e31a5a4bf16ec7#comment-e9bb24a7450c6b0d74fd
Use the dictionary and sets when referencing with in xxx. http://www.peignot.net/python-speed
When creating something, it is easy to create a function that creates the next status from the current status Example: Project Euler 28 http://qiita.com/cof/items/567dbc499fbf6d4aefb1 Project Euler 19 http://qiita.com/cof/items/44b380466e560de99e25
If the algorithm is improved by adding consideration to the data to be handled, the processing can be performed smoothly. Example: Project Euler 24 http://qiita.com/cof/items/874ddf45e86d94f817bf Project Euler 26 http://qiita.com/cof/items/567dbc499fbf6d4aefb1 Project Euler 10 http://qiita.com/cof/items/13dd1b3c29b43452cdc0
Efficient processing may be possible by modifying existing algorithms (* It is necessary to understand why existing algorithms are efficient. Example: Project Euler 21 http://qiita.com/cof/items/e86d6e6db090dd54b006 Example 2: Project Euler 12 http://qiita.com/cof/items/222d51c09b043da974af
It is important to set the final (initial) parameters when using recursion. (but slow in my implementation) Example; Project Euler 15 http://qiita.com/cof/items/e97797aa692d569164e3 Project Euler 18 http://qiita.com/cof/items/ccee79fbf84a93d21c1b
Speeding up can be measured by storing the calculation results. Example: Project Euler 14 http://qiita.com/cof/items/ddc4d797ff2979f1a3be Project Euler 9 http://qiita.com/cof/items/ef35068f3e63ede66eaf
There are many possible approaches, but they are not always faster. Example: Project Euler 4 http://qiita.com/cof/items/96fed868672ec1e0c404 Project Euler 5 http://qiita.com/cof/items/5c9670c4ac3f7988ae14
For speeding up, it is important to compare the benefits of speeding up with the costs spent on it. Example: Project Euler 2 2.21 Man spending 15 minutes to save microseconds http://qiita.com/cof/items/2591c15c6f63c89f304c
If you just ask for an answer, it's generally kind.
Looking back, I learned a lot.
Recommended Posts