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

Jenelle Miller
Jenelle Miller
5,989 Points

Is it still valid to write out a statement with a plus to join the variable into the sentence instead of using a coma?

Ex: print("I enjoy practice! I find it helps me to " + verb + " better.")

I noticed that the solution was different but my code still worked and I got no errors.

1 Answer

Steven Parker
Steven Parker
230,249 Points

A "print" will work on multiple arguments, but by using the "+" you are concatenating your message into a single string before it is printed.

As you noticed, either approach works for printing. The concatenation would be needed if you needed to access the combined string later.