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

total = current_count + upcoming_releases

Why not correct the syntax?

6 Answers

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hey Nam,

that line is correct,

Are you sure you haven't touched any other lines, for example, is the code from the first part of the challenge still there? Can you paste your code if the issues persists?

Thanks Vitto

current_count = 14
del planned = 5
upcoming_releases = 2
total = current_count + upcoming_releases

Here is all the code of the challenge.

Requirement: Excellent! Now I need you to add a new variable named total. Then assign total to the sum of current_count and upcoming_releases. I'd like you to use the variables, but if you just need to use the numbers, that's OK.

Error is Bummer! invalid syntax (delete.py, line 2)

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Like the error message says, your problem is on line 2 (del planned = 5). You can't del an assignment.

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hey Nam.

In task 1: You are not supposed to delete the line where the planned variable is set.

Your del statement is ok, but you want to leave the second line as it was provided. Then you will add the second task code as you wrote it.

Vitto

Oops! It looks like Task 1 is no longer passing.

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

So,

did you leave all the first 3 lines provided like they were and wrote your code below them?

Can you paste your new code again?

Vitto

I have checked it again. Same code. But now it work, maybe it's a bug.

current_count = 1
del planned = 5
upcoming_releases = 2
total = current_count + upcoming_releases```