Source: Dev.to | Jan 09, 2026 (UTC)
![Project Screenshot]!(https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l2u4hy9c4vfl8o2rwes0.png)
Screenshot from the Day 6 commit
Replace the above image URL with a real screenshot of your app output or code view!
🚀 What I Built — A Fixed Transport Route & Fare Reference System (Nigeria)
For Day 6 of the #30DaysOfPythonProjects challenge, I created a simple yet powerful Python script that stores immutable transport routes and fares using tuples. This helps commuters refer to fixed prices on common Nigerian routes — tackling the problem of arbitrary fare increases and lack of transparency.
In cities like Lagos, Abuja, and Port Harcourt, public transport commuters often struggle with inconsistent fare pricing because:
- Drivers change fares arbitrarily
- Passengers lack any fixed reference
- Everyday riders (students, civil servants, commuters) are affected
This system gives one source of truth for route pricing, making it easier to stay fair and informed.
The core idea is to use Python tuples, which are immutable — meaning they can’t be accidentally changed once defined. This is perfect for storing fixed route data that shouldn’t be modified casually.
- Tuples
- Tuple indexing
- Nested tuples
- Tuple unpacking
-
len()function - Clean formatted printing
Tuples help ensure the route and fare data stays fixed and consistent throughout the program. :contentReference[oaicite:0]{index=0}
Here’s a core part of the implementation:
python routes = ( ("Ojota", "Yaba", 500), ("CMS", "Lekki", 700), ("Wuse", "Garki", 300), ("Airport", "Ikeja", 1500) ) print("\nAVAILABLE TRANSPORT ROUTES") print("---------------------------") for route in routes: start, end, fare = route print(f"{start} → {end} : ₦{fare}") print("\nTotal Routes Available:", len(routes))
Enter fullscreen mode
Exit fullscreen mode


Залишити відповідь