Small improvement to "introduction"
Posted: Thu Dec 16, 2010 1:14 pm
In the introduction page you introduce assign multiple assignment in the Fibonacci example and use it to initialize variables. It would be useful to use it also for the calculation, because it makes the code imho clearer:
- Code: Select all
--- fib.cobra.old 2010-12-16 21:10:33.000000000 +0100
+++ fib.cobra 2010-12-16 21:11:01.000000000 +0100
@@ -4,6 +4,4 @@
n, a, b = 10, 0, 1
for i in n
print b
- save = a
- a = b
- b += save
+ a, b = b, a + b