From 6d8a770b73252ac8013d2acc2f36b5342c039cb6 Mon Sep 17 00:00:00 2001 From: Dario-DC <105294544+Dario-DC@users.noreply.github.com> Date: Tue, 15 Apr 2025 18:31:02 +0200 Subject: [PATCH] docs: remove reference to get_nth_statement --- src/content/docs/curriculum-help.mdx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/content/docs/curriculum-help.mdx b/src/content/docs/curriculum-help.mdx index c58359a6..009f0346 100644 --- a/src/content/docs/curriculum-help.mdx +++ b/src/content/docs/curriculum-help.mdx @@ -1117,19 +1117,6 @@ Node().is_empty() # True Node("x = 1").find_variable("x").is_empty() # False ``` -#### `get_nth_statement()` - -```python -stmts = """ -if True: - pass - -x = 1 -""" - -Node(stmts).get_nth_statement(1).is_equivalent("x = 1") # True -``` - #### `value_is_call()` This allows you to check if the return value of a function call is assigned to a variable. @@ -1184,6 +1171,19 @@ explorer.is_ordered("x=0", "x=1") # False explorer.find_ifs()[0].is_ordered("print(x)", "print('x is:')") # False ``` +#### How to get the nth statement + +```python +stmts = """ +if True: + pass + +x = 1 +""" + +Node(stmts)[1].is_equivalent("x = 1") # True +``` + ## Notes on Python - Python does **not** allow newline characters between keywords and their arguments. E.g: