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

Jonathan Alvarez
Jonathan Alvarez
549 Points

The first task why did he use string formatting on the first task vs just printing the string?

The first task

why did he use string formatting on the first task vs just printing the string?

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 46,420 Points

Hey Jonathan Alvarez ! :wave:

As this wasn't posted from a video or challenge, I'm not sure which page you're coming from. Could you provide a link to the video/quiz/challenge you're referring too? I can then take a look :smiley:

1 Answer

Steven Parker
Steven Parker
229,787 Points

When you say "…vs just printing" I'm guessing no printing was done in the first example. Could it be that the formatting was being used to prepare a string in a function that was then passed back as a return value? If so, then it would be because the objective was to create a return value instead of printing.

If I guessed incorrectly, please provide a link (and a video time index) to the issue you are referring to and I will revise my answer.