2023-03-23 22:49:17 +01:00
2023-03-23 10:58:59 +01:00
2023-03-23 22:49:17 +01:00
2023-03-23 10:57:05 +01:00
2023-03-23 21:12:43 +01:00

Brain Jogging PDF Generator

This Python script generates a brain jogging PDF with math problems. The PDF contains 20 rows with 4 math problems per row, chosen randomly from addition, subtraction, multiplication, and division. The PDF has two pages: the first page contains only the math problems, and the second page includes the problems along with their results.

Dependencies

  • Python 3
  • reportlab
  • 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.

License

This script is available under the MIT License.

S
Description
No description provided
Readme 117 KiB
Languages
Python 100%