Returns an 's' if plural. Useful in print statements to avoid something like 'point(s)'.
(x)
| 17 | sys.exit(2) |
| 18 | |
| 19 | def plural(x): |
| 20 | """ Returns an 's' if plural. |
| 21 | |
| 22 | Useful in print statements to avoid something like 'point(s)'. """ |
| 23 | if x > 1: |
| 24 | return 's' |
| 25 | return '' |
| 26 | |
| 27 | |
| 28 | # Make sure passing in filename argument. |