Minor changes
This commit is contained in:
@@ -9,26 +9,28 @@ This Python script generates a brain jogging PDF with math problems. The PDF con
|
||||
- argparse
|
||||
|
||||
You can prepare the environment and install the reportlab library using pip:
|
||||
|
||||
```
|
||||
python -m venv env
|
||||
source env/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
pip install reportlab
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You can run the script from the command line:
|
||||
|
||||
|
||||
```
|
||||
python brain-jogging.py [filename]
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
The script contains the following functions:
|
||||
|
||||
- format_and_return(a, b, operation, result): Formats and returns a math problem string along with its result.
|
||||
- generate_math_problem(): Generates a random math problem with an operation chosen from addition, subtraction, multiplication, or division.
|
||||
- create_brain_jogging_pdf(filename): Creates a brain jogging PDF with math problems and saves it to the specified filename.
|
||||
- main(): The main function that parses command-line arguments and calls the create_brain_jogging_pdf() function with the provided arguments.
|
||||
- `format_and_return(a, b, operation, result)`: Formats and returns a math problem string along with its result.
|
||||
- `generate_math_problem()`: Generates a random math problem with an operation chosen from addition, subtraction, multiplication, or division.
|
||||
- `create_brain_jogging_pdf(filename)`: Creates a brain jogging PDF with math problems and saves it to the specified filename.
|
||||
- `main()`: The main function that parses command-line arguments and calls the `create_brain_jogging_pdf()` function with the provided arguments.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user