Skip to content

jecarr/coding-exercise

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding exercise

This is a basic coding exercise created by the (UK) Cabinet Office.

Installing

(Please note, where python is referred to, use python or python3 as appropriate for your environment.)

Begin by cloning this repository. Next, change-directory to be in the coding-exercise folder and install dependencies:

python -m pip install -r requirements.txt

Launching the application

To run the application, you can do the following in the top-level exercise/ directory:

python manage.py runserver

You can then call the three endpoints (using either a web browser or a REST client application):

  • /hello/
  • /add-numbers/<first-number>/<second-number>/
  • /join-words/<first-word>/<second-word>/

Examples

  • /hello/
    • Returns Hello World
  • /add-numbers/10/20/
    • Returns 30
  • /join-words/hello/there/
    • Returns hello-there

Tests

You can run the test-suite (again in the top-level exercise/ directory) via:

python manage.py test tests/ --noinput

Original README and exercise-instructions are found in the original repo.

About

A basic coding exercise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.6%
  • HTML 6.4%