Welcome to the Treehouse Community
Looking to learn something new?
I can't figure out why my code isn't accepted because it passes in IDLE.
import datetime def time_tango(d, t): _date = d.strftime('%y-%m-%d') _time = d.strftime('%H:%M') _datetime = datetime.datetime.strptime(_date + ' ' + _time, '%y-%m-%d %H:%M') return _datetime
William LiCourses Plus Student 26,867 Points
Write a function named time_tango that takes a date and a time. It should combine them into a datetime and return it.
You can make use of the datetime.combine() method from the datetime module to combine date and time objects together.
import datetime def time_tango(d, t): return datetime.datetime.combine(d, t)