Update code sample
This commit is contained in:
parent
2db06baeb3
commit
e3484b9791
2 changed files with 372 additions and 722 deletions
8
book.org
8
book.org
|
@ -2941,10 +2941,10 @@ Previous iterations considered all the nodes that contained the relevant line (e
|
||||||
#+CAPTION: Sample code that simply reads a number from standard input and prints its digits.
|
#+CAPTION: Sample code that simply reads a number from standard input and prints its digits.
|
||||||
#+NAME: lst:feedbacksubtreesample
|
#+NAME: lst:feedbacksubtreesample
|
||||||
#+BEGIN_SRC python
|
#+BEGIN_SRC python
|
||||||
number = input()
|
def jump(alpha, n):
|
||||||
print(f'{number} has the following digits:')
|
alpha_number = ord(alpha)
|
||||||
for digit in number:
|
adjusted = alpha_number + n
|
||||||
print(digit)
|
return chr(adjusted)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+CAPTION: AST subtree corresponding to line 3 in Listing\nbsp{}[[lst:feedbacksubtreesample]].
|
#+CAPTION: AST subtree corresponding to line 3 in Listing\nbsp{}[[lst:feedbacksubtreesample]].
|
||||||
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 54 KiB |
Loading…
Add table
Add a link
Reference in a new issue