Hacker News new | past | comments | ask | show | jobs | submit login

A well-written tutorial, but mildly annoying that it starts off with a basic off-by-one error; 9am to 9pm is 13 trips, not 12, so the total trip number is 52 (which indeed is the number of trips shown in the example, not 48 as stated just above).



I interpreted it as the bus starting at 9am and stopping at 9pm, making for 12 trips of one hour each. So the off-by-one error would be in the code generating the possible trips.

In fact, the code as shown only produces 48 trips, instead of the 52 given. I had to actually run it to make sure the Python interpreter in my had wasn't buggy. No idea what code they actually ran to get that result.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: