All problems

Generating a Custom Color Palette

mediumPythonSeaborncolor_palette

A Marlow & Finch client wants their charts coloured from a single continuous ramp rather than from a set of unrelated hues, so that a series with more categories still reads as one family. The studio's build script asks the ramp for as many evenly spaced colours as the chart needs, checking it got what it asked for before anything is drawn.

Task: Print how many colours the generated palette holds.

Input

One line holding a single integer n, the number of colours requested, where 1 <= n <= 100.

Output

One line holding a whole number: how many colours are actually in the palette that was built. Sampling a ramp for n colours returns exactly n of them, evenly spaced along it.

Example:

Input:
5

Output:
5

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…