This file contains hidden or 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
| # 複合キーを使用した辞書 | |
| tuple_dict = { | |
| (1, 'test'): 'this is first test.', | |
| (2, 'test'): 'this is secound test.', | |
| } | |
| print(tuple_dict[1, 'test']) # this is first test. | |
| # クラスの継承ではなく委譲 |
This file contains hidden or 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
| # If you want to search for data that includes spaces with spaces removed, try the following method | |
| REPLACE(data, ' ', '') | |
| # If you use Japanese, you also need to remove full-width space. | |
| REPLACE(REPLACE(data, ' ', ''), ' ', '') |
This file contains hidden or 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
| # 絶対値 | |
| absolute_value = abs(-123) | |
| print(absolute_value) # 123 | |
| # 商と剰余 | |
| div_mod = divmod(10, 3) | |
| print(div_mod) # (3, 1) | |
| # 累乗 | |
| power = pow(2, 3) |