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 Timedelta Minute

David Hernandez
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
David Hernandez
Python Development Techdegree Graduate 12,180 Points

Not understanding what is being asked here, completely lost on this question and can't get past it.

Not understanding what is being asked here, completely lost on this question and can't get past it.

minutes.py
import datetime

def minutes(start_time, end_time):
    delta_seconds = (start_time - end_time).timedelta.totalseconds()
    print(delta_seconds)
    return round(delta_seconds / 60)

1 Answer

Steven Parker
Steven Parker
231,275 Points

You're prety close, but:

  • you won't use the term "timedelta" — the result of the subtraction is a timedelta.
  • the name of the method is "total_seconds" (with an underscore)
  • the instructions say to "subtract the first [argument] from the second"
  • the function doesn't need to print anything
David Hernandez
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
David Hernandez
Python Development Techdegree Graduate 12,180 Points

Thank you! I was able to figure it out once I stepped away and then reread. I noticed the number too was close but negative. I appreciate the support.