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 trialLiana Moleni
2,644 Pointsfunction called far_away challenge
im not sure i did not understand the concept or its something else. please help!!!!
import datetime
def far_away(timedelta):
datetime.datetime.now() + datetime.timedelta(hours=5)
return datetime.datetime
1 Answer
Dan Johnson
40,533 PointsYou're already being sent in a timedelta
so you don't need to create a new one. You'll also need to either save the result in a variable or return it right away.
# Save for a return
result = datetime.datetime.now() + timedelta
On a side note, this:
return datetime.datetime
will return the class itself rather than a new datetime
instance. So if you used the first example you'd want to return result instead.
Liana Moleni
2,644 PointsLiana Moleni
2,644 Pointsthank you