Skip to content

Commit 6c0e1eb

Browse files
authored
docs: remove reference to get_nth_statement (#674)
1 parent 71d9f64 commit 6c0e1eb

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/content/docs/curriculum-help.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,19 +1117,6 @@ Node().is_empty() # True
11171117
Node("x = 1").find_variable("x").is_empty() # False
11181118
```
11191119
1120-
#### `get_nth_statement()`
1121-
1122-
```python
1123-
stmts = """
1124-
if True:
1125-
pass
1126-
1127-
x = 1
1128-
"""
1129-
1130-
Node(stmts).get_nth_statement(1).is_equivalent("x = 1") # True
1131-
```
1132-
11331120
#### `value_is_call()`
11341121
11351122
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
11841171
explorer.find_ifs()[0].is_ordered("print(x)", "print('x is:')") # False
11851172
```
11861173
1174+
#### How to get the nth statement
1175+
1176+
```python
1177+
stmts = """
1178+
if True:
1179+
pass
1180+
1181+
x = 1
1182+
"""
1183+
1184+
Node(stmts)[1].is_equivalent("x = 1") # True
1185+
```
1186+
11871187
## Notes on Python
11881188
11891189
- Python does **not** allow newline characters between keywords and their arguments. E.g:

0 commit comments

Comments
 (0)