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

How to add a new variable

How do you add a new variable

delete.py
current_count = 14
total current_count = 14
del current_count
planned = 5
del planned
upcoming_releases = 2
total upcoming_releases = 2
del upcoming_releases

1 Answer

Steven Parker
Steven Parker
230,995 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.