Giter Club home page Giter Club logo

leadzai_tt's Introduction

Leadzai_tt

Exercise:

Imagine you’re creating a footer with pagination to browse through the several pages of a given website. Let’s assume the usage of the following variables for the effect:

  • current_page
  • total_pages
  • boundaries: how many pages we want to link in the beginning, or end (meaning, how many pages starting at page 1 and how many leading up to the last page, inclusive)
  • around: how many pages we want to link before and after the current page, exclusive. For pages with no direct link we should use one set of three points (...) per set of pages hidden. Some examples:
  1. current_page = 4; total_pages = 5; boundaries = 1; around = 0 Expected result: 1 ... 4 5
  2. current_page = 4; total_pages = 10; boundaries = 2; around = 2 Expected result: 1 2 3 4 5 6 ... 9 10 The code should print the result and not only calculate it.

Installation

Python 3 should be installed.

https://github.com/Oomamchur/Leadzai_tt
cd Leadzai_tt
python -m venv venv

On Windows:

source venv\Scripts\activate

On macOS or Linux:

source venv/bin/activate

Install requirements:

pip install -r requirements.txt

Run code

python pagination.py

Run tests

pytest

leadzai_tt's People

Contributors

oomamchur avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.