Michael Foord, author of IronPython in Action, is creating a ‘Try Python: Interactive Python Tutorial’ site. Built with Microsoft Silverlight and IronPython.
Fibonacci PowerShell Example
He presents a Fibonacci example and demonstrates multiple assignment for variables.
In this PowerShell example, the second line sets the variables a and b to 0 and 1. Then again in the sixth line. Notice that the expression ($a+$b) is evaluated and then assigned.
Function Fibonacci($n=10) { $a, $b = 0, 1 while($b -lt $n) { $b $a, $b = $b, ($a+$b) } } Fibonacci 20


{ 0 comments… add one now }