https://github.com/compscirocks/truth-table-builder
Python script to build truth tables
https://github.com/compscirocks/truth-table-builder
Last synced: 2 months ago
JSON representation
Python script to build truth tables
- Host: GitHub
- URL: https://github.com/compscirocks/truth-table-builder
- Owner: CompSciRocks
- Created: 2021-10-12T18:12:17.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-14T16:37:34.000Z (over 4 years ago)
- Last Synced: 2025-11-05T12:26:31.861Z (8 months ago)
- Language: Python
- Size: 1000 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
## Truth Table Builder
I needed a way to build truth tables for class, and I really didn't want to solve them manually. So I did what most programming nerds would do and kick out a quick script.
### Usage
From the command line run the script with the boolean expression as an command line option.
```
python build.py "A && B || C"
```
If you're a python person, you can also use `and` instead of `&&` and `or` instead of `||`.
A couple of notes.
The variables need to be single capital letters. Lower cased letters will cause issues.
And the expression should be wrapped in double quotes.
### Output
Running the example above will produce the following output.
```
A B C A && B || C
True True True True
True True False True
True False True True
True False False False
False True True True
False True False False
False False True True
False False False False
```