Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 499 Bytes

File metadata and controls

19 lines (13 loc) · 499 Bytes

Python Coding Exercise

String Calculator

Using Python with a Test Driven approach, create a simple String Calculator which covers the following requirements:

  1. Adds numbers present in the input, e.g "1,2" = 3, "10,4" = 14
  2. Treats empty or null input as zero, e.g "" = 0, null = 0
  3. Supports different delimiters, e.g "1,2,3", "1 2 3"
  4. Does not support negative numbers
  5. Ignores numbers greater than 100

Usage:

python coding_task

Run unit tests:

python -m pytest