London Bus Timetable

london-tourFor this challenge, we will write a Python script to extract relevant information from a bus timetable to help end-users plan their journey.

Check the following timetable to answer the questions listed below:
bus-timetable

  • At what time will I reach Buckingham Palace if I take the 11:45 bus from St Paul’s Cathedral?
  • At what time will I reach Oxford Circus if I take the 14:44 bus from Tower Bridge?
  • I am planning to finish the visit of Tate Modern around 10:00? What would then be the earliest time for me to be at Covent Garden?

Python Challenge


We have started some code to load the content of the above timebale into a 2-dimensional array (list of lists in Python) called timetable.

Your task is to complete the code to:

  • Asks the user for the bus station they will take the bus from,
  • Asks the user at what time they will be at the bus station,
  • Asks the user where do they want to go,
  • Outputs the earliest time the user can reach their destination.

Share Button
Posted in Computer Science, Python - Advanced, Python Challenges

Our Latest Book