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 trialHaftu Gebrehiwot
974 Pointsadding new variable
Excellent! Now I need you to add a new variable named total. Then assign the sum of current_count and upcoming_releases to total. I'd like you to use the variables, but if you need to use the numbers, that's OK.
current_count = 14
del current_count
planned = 5
del planned
upcoming_releases = 2
total= current_count + upcoming_releases
del upcoming_releases
1 Answer
Steven Parker
231,248 Pointsnew variables are super easy in Python.
Anytime you assign a value to a variable, Python creates is for you if it did not already exist. So just add your new variable name, the assignment operator, and the value you want it to have. For example, in the code above, the very top line creates the variable named "current_count ".
Be careful not to change any of the lines that the challenge started with. For these tasks you only need to add a tiny bit of new code to the bottom.
Steven Parker
231,248 PointsSteven Parker
231,248 PointsIt looks like you asked this same question just an hour ago.