Skip to content

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS Answers

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

Topic Idiomatic One-liners One-liners[strict]
Fundamentals and data handling
Data handling libraries
Control flow and iterative statements
Strings
Lists
Tuples
Dictionaries
Functions

Assignment Solutions

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

Test Solutions

Topic Idiomatic One-liners One-liners[strict]
FA2

Difference between one-liners and one-liners[strict]

  • 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].

Contributing

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

About

Answers for question banks, tests, assignments given in CS class

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages