Skip to content

Commit 3474c07

Browse files
authored
Explicitly non-digit characters in testing exercise (#2723)
Students sometimes ask about this so I figure it'd be good to specify in the text.
1 parent 3beda36 commit 3474c07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/testing/exercise.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used to
88
validate credit card numbers. The algorithm takes a string as input and does the
99
following to validate the credit card number:
1010

11-
- Ignore all spaces. Reject numbers with fewer than two digits.
11+
- Ignore all spaces. Reject numbers with fewer than two digits. Reject letters
12+
and other non-digit characters.
1213

1314
- Moving from **right to left**, double every second digit: for the number
1415
`1234`, we double `3` and `1`. For the number `98765`, we double `6` and `8`.

0 commit comments

Comments
 (0)