2008-06-19から1日間の記事一覧
Structure and Interpretation of Computer Programs sec_1.1.8 #1.1.8 Procedures as Black-Box Abstractions(ブラックボックス抽象化の手続き) #Internal definitions and block structure(内在的な定義とブロック構造) #平方根の例 def square(x): re…
SICP 1.2 Procedures and the Processes They Generate(手続きと生成プロセス) ## 1.2.1 Linear Recursion and Iteration(線形の再帰と反復) # 図 1.3:再帰の例 def factorial(n): if n == 1: return 1 return n * factorial(n - 1) print factorial(6) …