Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Dates and Times in Python (2014) Let's Build a Timed Quiz App Simple Time Machine

Kenneth Bagwell Jr
Kenneth Bagwell Jr
3,698 Points

delorean question

honestly not sure what I should be adding to the function

time_machine.py
import datetime


def delorean(num):
    datetime = r   
    return datetime


tarter = datetime.datetime(2015, 10, 21, 16, 29)

1 Answer

Steven Parker
Steven Parker
231,110 Points

Here's a few hints:

  • don't change the provided code (like changing "starter" to "tarter")
  • you should probably add new code after the provided code
  • nothing named "r" has been defined
  • to avoid confusion and possible errors, don't give variables the same names as functions or packages
  • the function parameter "num" isn't being used inside the function (but should be)
  • you will also want to use "starter" inside the function
  • your function should compute a time that is "num" hours later than "starter"
  • the timedelta function might be useful here