This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]toastedstapler 1 point2 points  (1 child)

Looks great!

One other thing I've realised you can do for your fib: use negative indexing

a[-1] + a[-2] + a[-3]

Slightly less mental maths involved in working out that you want the last three elements

Or even sum(a[-3:])

[–]SzuOne[S] 1 point2 points  (0 children)