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
a2p
1,624 PointsChallenge: Things that count
age = 29
days = age * 52 * 7
decades = float(age / 10)
estimate = round(decades)
summary = "I am {} days old! That's about {} decades!".format(days, str(estimate))
At fourth task I am getting an error about task one. I can't understand where is my error. The error message is this,
"Oops! It looks like Task 1 is no longer passing."
In addition I can't write decades = age / 10 and I thought python converts automatically an integer division in a float.
Thank you in advance for your help
1 Answer
Sreng Hong
15,083 PointsYou have to put the number between the bracket {} and the estimate variable should be integer.
This is the right code:
age = 29
days = age * 52 * 7
decades = float(age / 10)
estimate = int(round(decades))
summary = "I am {0} days old! That's about {1} decades!".format(days, estimate)
a2p
1,624 Pointsa2p
1,624 PointsThank you. That's right.
Sreng Hong
15,083 PointsSreng Hong
15,083 PointsYour welcome