0 of 6 problems solved • 0%

Exercise prompt

Join a Route

When the same cleaning rule applies to two inputs, give it one name and use it twice.

Example

def twice(value): return 2 * value def frame_length(width, height): return twice(width) + twice(height) print(frame_length(2, 5)) # 14

Both dimensions go through the same helper. The outer function combines its two results.

Your task

Complete both functions. station_code(name) strips whitespace, takes the first three characters and uppercases them. route_code(start, end) joins two such codes with a hyphen. Short station names keep all their characters.