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 trialNick Honegger
Front End Web Development Techdegree Student 8,773 PointsTask 1 no longer passing
Every time I add estimate = it says Task 1 is no longer passing.
age = 23
days = age * 52 * 7
decades = age / 10
estimate = decades.int
summary = "I am {} days old! That's about {} decades!" (days, estimate)
That is the code I'm trying, did I mess something up in the beginning that is causing that error in particular?
2 Answers
Logan R
22,989 PointsYou need to round your estimate, not make it an integer.
You also forgot to add .format the end of your summary.
estimate = round(decades)
summary = "I am {} days old! That's about {} decades!".format(days, estimate)
Hope this helps you out!
Jason Anello
Courses Plus Student 94,610 PointsHi Nick,
For estimate
you want to round off the decades using the round()
function.
For the summary
variable you're missing .format
Kenneth Love
Treehouse Guest TeacherKenneth Love
Treehouse Guest Teacherdecades
, a float, doesn't have an attribute namedint
, sodecades.int
will throw an exception.Since all of the previous tests are run against every step, the exception is making the test runner thing step 1 is failing.