- 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
Forums
Small improvement to "introduction"
5 posts
• Page 1 of 1
Small improvement to "introduction"
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:
- johannes.krampf
- Posts: 11
- Location: Suisse Romande
Re: Small improvement to "introduction"
Nice catch. I agree.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Small improvement to "introduction"
Thanks. Another small thing:
On the same page, in the last example, there's a def init instead of the correct cue init.
I don't know if this is deliberate to get new users acquainted with the documentation, but it confused me when I tried the example and I checked the code thrice to see if I made any typing errors until I made the change suggested by the compiler.
On the same page, in the last example, there's a def init instead of the correct cue init.
I don't know if this is deliberate to get new users acquainted with the documentation, but it confused me when I tried the example and I checked the code thrice to see if I made any typing errors until I made the change suggested by the compiler.
- johannes.krampf
- Posts: 11
- Location: Suisse Romande
Re: Small improvement to "introduction"
Wow, more "def init"s lurking in the docs. This inspired me to search the docs and find a couple more documents with this problem. Now fixed.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 44 guests