Add the "Org Babel Ackermann Python test" section
This commit is contained in:
parent
b7f824e942
commit
7bf5fde5bc
32
README.org
32
README.org
@ -5043,6 +5043,38 @@ ruff "$@" | cat
|
|||||||
# End:
|
# End:
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** Org Babel Ackermann Python test
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: sec:obap-test
|
||||||
|
:END:
|
||||||
|
|
||||||
|
#+caption[Org Babel Ackermann Python test]:
|
||||||
|
#+caption: Org Babel Ackermann Python test.
|
||||||
|
#+name: lst:obap-test
|
||||||
|
#+header: :wrap "src text -n"
|
||||||
|
#+begin_src python -n :eval never-export :exports both :session
|
||||||
|
# https://rosettacode.org/wiki/Ackermann_function#Python
|
||||||
|
# https://www.youtube.com/watch?v=i7sm9dzFtEI
|
||||||
|
|
||||||
|
def ack(M, N):
|
||||||
|
if M == 0:
|
||||||
|
return N + 1
|
||||||
|
elif N == 0:
|
||||||
|
return ack(M - 1, 1)
|
||||||
|
else:
|
||||||
|
return ack(M - 1, ack(M, N - 1))
|
||||||
|
|
||||||
|
ack(3, 3)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+caption[Org Babel Ackermann Python test result]:
|
||||||
|
#+caption: Org Babel Ackermann Python test result.
|
||||||
|
#+name: lst:obap-test-result
|
||||||
|
#+RESULTS: lst:obap-test
|
||||||
|
#+begin_src text -n
|
||||||
|
61
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** [[https://pip.pypa.io/en/stable/][Package Installer for Python]]
|
*** [[https://pip.pypa.io/en/stable/][Package Installer for Python]]
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: sec:pip-python
|
:CUSTOM_ID: sec:pip-python
|
||||||
|
Loading…
x
Reference in New Issue
Block a user