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 trialNaomi Freeman
Treehouse Guest TeacherThat escalated quickly
Working on this new python course.
Question 1: Create a variable named age that contains your age.
Question 2: Now, create a variable named days that is your age multiplied by 52 (we'll pretend today is your birthday) and divided by 7.
age = 25
days = (age*52/7)
Perfect. That was easy.
And then question 3 is just BAM Finally, create 2 new variables, one named estimate that holds the rounded number of days you've lived and, one named summary that adds the string version of estimate into "I am {} days old!”.
Uh ... I have no idea.
This ain't it:
estimate = round(len(days)
summary = "I am {} days old!".format(estimate)
Not if I put brackets around them either.
Please help.
4 Answers
Joseph Kato
35,340 PointsYou just need to omit the call to the len
function, leaving:
estimate = round(days)
summary = "I am {} days old!".format(estimate)
Naomi Freeman
Treehouse Guest TeacherThanks :) Clearly I don't understand the code yet aha Was just trying to mimic what the tutorial did.
Much appreciated.
MUZ140132 Norest Makuyana
953 Pointsestimate=round(days) summery="I am{} days old!".format (estimate)
MUZ140132 Norest Makuyana
953 Pointssummery="i am{27*52*7} days old!".
Tonderai Sydney Musonza
Python Development Techdegree Student 4,814 PointsTonderai Sydney Musonza
Python Development Techdegree Student 4,814 Pointson question three. you just have to do the string formatting concept e.g
summary = "i am {} days old".format(days)