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 trialJamison Imhoff
12,460 PointsDatetime Code Challenge Help!
I tried to use the python doc to help pass this challenge , but either I am not running it correctly or am using the wrong thing. ( https://docs.python.org/2/library/datetime.html#datetime.datetime.combine )
I guess I am not quite understanding what the Challenge is wanting me to do...
help?
import datetime
def time_tango(date, time):
return datetime.combine(date, time)
2 Answers
Tree Casiano
16,436 PointsYou are very close. This may seem strange, but you need to include datetime twice in your return statement, like so: return datetime.datetime.combine(date, time)
Kenneth Love
Treehouse Guest TeacherYeah, the datetime
module has a datetime
class inside of it that you need to use. It's weird to type datetime.datetime
but you'll a) use this all the time in production code; and b) see this pattern in many other modules, too.
Also, make sure you're always using the docs for Python 3. Your link up there goes to Python 2.
Jamison Imhoff
12,460 PointsJamison Imhoff
12,460 PointsKenneth Love ?