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

PH Oracius
PH Oracius
257 Points

step 2 keeps bringing me back to step 1

step refers me back to step saying it is not passing although i had already got it correct.

delete.py
current_count = 14
planned = 5
upcoming_releases = 2
del planned = 5
sum = "total"
current_count + upcoming_releases = "total"
print (sum)

1 Answer

Gabbie Metheny
Gabbie Metheny
33,778 Points

Usually a "Task 1 is no longer passing" error means that something is going on in your new code that's messing up your first answer. Right now, you have a lot of extraneous code that could be throwing off the interpreter. Let's try and simplify:

  1. The challenge doesn't ask you to print anything, so you can remove the line where you print sum.
  2. When you delete planned, you shouldn't include the = 5: the interpreter already knows what your variable holds, and it will delete the whole thing. del planned is sufficient.
  3. Currently, you're assigning the string "total" to the variable sum, and on the following line you're adding the two variables and setting them to the string "total" as well, but your variable should be named total and it should be assigned the sum of the other remaining variables (current_count and upcoming_releases), like so: total = current_count + upcoming_releases. The word sum shouldn't appear anywhere in your code, sum is just the description of the task you need to accomplish: adding two things.

In all, you should only need to add two lines of code to the starter code to complete this challenge. Let me know if you're still having trouble!