Exercise

Recreating ISO format with strftime()

In the last chapter, you used strftime() to create strings from date objects. Now that you know about datetime objects, let's practice doing something similar.

Re-create the .isoformat() method, using .strftime(), and print the first trip start in our data set.

Reference
%Y4 digit year (0000-9999)
%m2 digit month (1-12)
%d2 digit day (1-31)
%H2 digit hour (0-23)
%M2 digit minute (0-59)
%S2 digit second (0-59)

Instructions

100 XP
  • Complete fmt to match the format of ISO 8601.
  • Print first_start with both .isoformat() and .strftime(); they should match.