{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "33faf7ad-a3fd-4ac4-a0c3-52e507ed49df",
   "metadata": {},
   "outputs": [],
   "source": [
    "x = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "481fb4bf-c1b9-47da-927f-3cfdfe4b49ec",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Simple case\n",
    "x == 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2f0c65a5-0a0e-4080-afce-5a8ed0d706df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Only skip the last expression\n",
    "x == 1  # B018\n",
    "x == 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5a3fd75d-26d9-44f7-b013-1684aabfd0ae",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Nested expressions isn't relevant\n",
    "if True:\n",
    "    x == 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e00e1afa-b76c-4774-be2a-7223641579e4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Semicolons shouldn't affect the output\n",
    "x == 1;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "05eab5b9-e2ba-4954-8ef3-b035a79573fe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Semicolons with multiple expressions\n",
    "x == 1; x == 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "9cbbddc5-83fc-4fdb-81ab-53a3912ae898",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Comments, newlines and whitespace\n",
    "x == 1 # comment\n",
    "\n",
    "# another comment"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python (ruff-playground)",
   "language": "python",
   "name": "ruff-playground"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
