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
Enzo Cnop5,157 Points
Practical difference between using "+" to append a list and "+="
In practice, what is the difference between using the 'temporary' modifier of a list '+' and the 'permanent' modifier '+='. Obviously one is temporary and one is permanent, but those terms are rather subjective. When does Python decide to forget a temporary list change? How could this be used to my advantage?
Steven Parker228,991 Points
+=" is an addition assignment operator.
It basically combines addition and assignment at the same time. As Jack mentioned, "
x += y" is essentially the same as "
x = x + y". Both of these are types of assignments, so they permanently change the item on the left.