Skip to content

readingbat/readingbat-python-content

Repository files navigation

ReadingBat Python Content

Python programming challenges served by the ReadingBat platform. Students solve challenges in the browser; the server evaluates answers by running Python functions against test cases defined in each file.

Prerequisites

  • Java 17+

Setup

make compile    # Build without tests
make tests      # Run all tests
make run        # Start the server on port 8080

Adding a Challenge

  1. Create a Python file in python/<group_dir>/ following this pattern:
# @desc Description of the challenge

def challenge_name(param1, param2):
    return result

def main():
    print(challenge_name(arg1, arg2))  # each print = one test case

if __name__ == '__main__':
    main()
  1. Register the challenge in src/main/kotlin/Content.kt — either add a challenge() call or ensure the filename matches an existing includeFilesWithType glob.

  2. Run make tests to verify.