Differences between revisions 1 and 2
Revision 1 as of 2018-10-25 12:55:20
Size: 498
Comment:
Revision 2 as of 2018-10-25 12:56:07
Size: 486
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
triangle_number = lambda n: int( n * (n + 1) / 2 ) mersenne_number = lambda n: 2 ** n - 1

[ edit ]

  • 【高度な話題/別解】メルセンヌ数
    • λ式(ラムダ式)をつかえば,以下のように定義することもできます

mersenne_number = lambda  n: 2 ** n - 1

SoftEng: Python/Prog/Example/02/Ex_002a/AdvancedTopics (last edited 2018-10-28 12:22:27 by TadashiIijima)