Update code sample

This commit is contained in:
Charlotte Van Petegem 2024-02-28 20:14:09 +01:00
parent 2db06baeb3
commit e3484b9791
No known key found for this signature in database
GPG key ID: 019E764B7184435A
2 changed files with 372 additions and 722 deletions

View file

@ -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

Before After
Before After