3 ms·
to be concrete: fac = lambda n: 1 if n<=1 else n*fac(n-1) a, b = fac(42), fac(69) a + b is 3 lines of python; how many lines of C code would it ta
by 082349872349872 3y ago
to be concrete:
fac = lambda n: 1 if n<=1 else n*fac(n-1)
a, b = fac(42), fac(69)
a + b
is 3 lines of python; how many lines of C code would it take to execute?
- tgv 3y agoOne: return 1.7112245243e98 Joking aside: these are not catch-all comparisons. Nor is the article. But Python is mucher slower and much safer than C. It's easier to start in Python than in C.
- 082349872349872 3y ago;-P Just to be pedantic, if you're going to all the trouble to give (modulo lack of a repl) a wrong answer fast, might as well do it really quickly: return 0; in the hopes that compiles down to something like: xor rax, rax ret