4 ms·
I've grown fond of using: ------------------ def alpha(n): if(n <= 1): return n else: return(alpha(n-1) + alpha(n-2)) w
by jwkane 7y ago
I've grown fond of using:
------------------
def alpha(n):
if(n <= 1):
return n
else:
return(alpha(n-1) + alpha(n-2))
what is alpha(5)?
-----------------
Instead of fizz. They don't have to recognize that it is fib or do it in their head, on paper is fine. No perfect syntax under pressure to worry about. I feel okay with an easy smile, handshake and thank you for your time when I get that confused/embarrassed/angry look like I've just asked them to translate hieroglyphics. Works out nicely.