时间为何棘手:最长与最短
在 W20529 的 291 次行程中,最长的时长是多少?最短的时长是多少?有没有看起来不太对劲的地方?
与之前一样,数据已加载为 onebike_durations。
本练习是课程的一部分
在 Python 中处理日期和时间
练习说明
- 从
onebike_durations计算shortest_trip。 - 从
onebike_durations计算longest_trip。 - 打印结果,并将
shortest_trip和longest_trip转为字符串以便打印。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Calculate shortest and longest trips
shortest_trip = ____(____)
longest_trip = ____(____)
# Print out the results
print("The shortest trip was " + ____ + " seconds")
print("The longest trip was " + ____ + " seconds")