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 (2015) Python Data Types Del

adding 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.

delete.py
current_count = 14
del current_count
planned = 5
del planned
upcoming_releases = 2
total= current_count + upcoming_releases
del upcoming_releases
Steven Parker
Steven Parker
231,275 Points

It looks like you asked this same question just an hour ago.

1 Answer

Steven Parker
Steven Parker
231,275 Points

new 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 ".

:warning: 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.