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 Python Basics (Retired) Things That Count Things That Count

When I try task 3 I get an error message saying Task 1 is no longer passing. I haven't touched task 1.

I don't know why this is the case. Like I said, I never changed task 1 when I tried task three and don't really see how it could be incorrect seeing as how its a single variable.

days_alive.py
age = 20
days = age*52*7
summary = ("I am " + days + " days old!")

2 Answers

Seth Reece
Seth Reece
32,867 Points

Hi Ian,

When you get this error, it usually means there is a syntax error in your current challenge. If you go back to step one and run your code your will often get a better error description. In this case, the way your are putting summary together it says "Can't convert 'int' object to str implicitly". The best way to do this challenge is using a placeholder. e.g.

age = 20
days = age * 52 * 7
summary = "I am {} days old!".format(days)

ah, I see how yours works. It makes more sense. Is there a logical reason as to why it doesn't like what I was typing in, or is it just picky with converting ints into strings.

On another note I ran it through eclipse to see what error I was getting and it was exactly what you said. Google searches wern't as concise as your answer though.

Thanks!

Seth Reece
Seth Reece
32,867 Points

When you tried to concatenate, you where put an int in the middle of a string you will get an error. .format() converts your int to a string automatically. str.format docs