This repository is not intended to be used standalone without the given classroom resource.
None of the one-liners given here are idiomatic. Please do not write production code using this as an example.
Table of contents:
- Question Bank Solutions
- Assignment Solutions
- Test Solutions
- Journal Solutions
- Practical Solutions
- Difference between one-liners and one-liners[strict]
- Contributing
| Topic | Idiomatic | One-liners | One-liners[strict] |
|---|---|---|---|
| Fundamentals and data handling | ✔ | ||
| Data handling libraries | |||
| Control flow and iterative statements | ✔ | ||
| Strings | ✔ | ||
| Lists | ✔ | ||
| Tuples | ✔ | ||
| Dictionaries | ✔ | ||
| Functions | ✔ |
| Topic | Idiomatic | One-liners | One-liners[strict] |
|---|---|---|---|
| Flow of control | ✔ | ||
| String manipulation | ✔ | ||
| SA1 practice | ✔ | ||
| Lists | ✔ | ||
| Practice 1 | ✔ | ||
| Dictionaries | ✔ | ||
| Practice 2 | ✔ | ||
| Practice 3 | ✔ | ||
| Functions 1 | ✔ | ||
| Functions 2 | ✔ |
| Topic | Idiomatic | One-liners | One-liners[strict] |
|---|---|---|---|
| FA2 | ✔ |
- One-liners: Code written in a single line, using a single statement.
Statements separated by semi-colons in a single line are prohibited.
Exceptions (non-exhaustive):
- Import statements
- Guidelines imposed by the question ("define a function to-")
- Misc reasons which make code longer by a few lines
- One-liners[strict]: Same as One-liners, except there are no exceptions. If an answer requires multiple lines, it is categorized into one-liners instead of one-liners[strict].
Found a better solution to an answer? Perhaps one that reduces the number of statements in an answer? Excellent! Please open a pull request or otherwise send your changes to me, while adhering to the following:
- Don't reduce a one-liners[strict] rating to a one-liners rating (see difference)
- In idiomatic files, name variables well