← Questions
Train fare calculator with a weekend cap
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A train line runs through stations G, U, H, K and I in that order. Each hop between neighbouring stations costs 1, so a trip costs the number of hops it covers (G to I costs 4). Build it in three steps: a fare function for one trip, then let the list of stations change, then cap what a rider pays over a weekend.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
