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) Dates and Times Far Away

daniel refael
daniel refael
1,679 Points

I do not understand what I am doing here wrong

I do not understand what I am doing here wrong

far_away.py
import datetime
from datetime import timedelta



def far_away(h, m, s):
    return datetime.datetime.now()+ datetime.timedelta(hours=h, minutes=m, seconds=s)

1 Answer

Steven Parker
Steven Parker
231,269 Points

The instructions ask for a function "that takes one argument, a timedelta", but the code shown here creates a function that takes three arguments that are an hour, a minute, and a second.

So you won't need to make a new timedelta, just use the one that will be passed in.