Skip to content

Add python-or-operator materials folder - #1002

Open
realpython-bot wants to merge 1 commit into
masterfrom
maintenance/python-or-operator-20261204
Open

realpython-bot wants to merge 1 commit into
masterfrom
maintenance/python-or-operator-20261204

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Adds the sample-code folder for the Real Python tutorial Using the "or" Boolean Operator in Python (https://realpython.com/python-or-operator/), which had no folder in this repo yet.

What's in it

One script per tutorial section, mirroring the code as the updated draft shows it: boolean_expressions.py, short_circuit.py, if_statements.py, while_loops.py, default_values.py, mutable_defaults.py, zero_division.py, lambda_expressions.py, plus a README.md with setup and a script-to-section table. Standard library only, so there's no requirements.txt. REPL echoes became print() calls; the two intentional ValueErrors are caught and printed; while_loops.py ships a simulated measure_temp() with three fixed readings so the loop terminates.

Verification

  • Every script run on CPython 3.15.2; output matches the tutorial's REPL sessions.
  • ruff==0.14.1 format --check and check: clean (one # noqa: E731 on the lambda-assignment demo, which is the lesson).
  • .github/workflows/dircheck.py: passes.

Links

🤖 Generated with Claude Code

Sample code for the Real Python tutorial "Using the \"or\" Boolean Operator in Python" (https://realpython.com/python-or-operator/), one script per tutorial section. Standard library only; verified on Python 3.15.2.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant