---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B018 Found useless expression. Either assign it to a variable or remove it.
 --> B018.ipynb:5:1
  |
3 | x
4 | # Only skip the last expression
5 | x  # B018
  | ^
6 | x
7 | # Nested expressions isn't relevant
  |

B018 Found useless expression. Either assign it to a variable or remove it.
  --> B018.ipynb:9:5
   |
 7 | # Nested expressions isn't relevant
 8 | if True:
 9 |     x
   |     ^
10 | # Semicolons shouldn't affect the output
11 | x;
   |

B018 Found useless expression. Either assign it to a variable or remove it.
  --> B018.ipynb:13:1
   |
11 | x;
12 | # Semicolons with multiple expressions
13 | x; x
   | ^
14 | # Comments, newlines and whitespace
15 | x  # comment
   |
