Exercise

Setting timezones

Now that you have the hang of setting timezones one at a time, let's look at setting them for the first ten trips that W20529 took.

timezone and timedelta have already been imported. Make the change using .replace()

Instructions

100 XP
  • Create edt, a timezone object whose UTC offset is -4 hours.
  • Within the for loop:
  • Set the tzinfo for trip['start'].
  • Set the tzinfo for trip['end'].