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

hello all ,

how we can solve this problem

10 Answers

Kevin Faust
Kevin Faust
15,353 Points

Yasser Shaaf

#WRONG SOLUTION
current_count = 14
del planned = 5  #you are trying to assign the "planned" variable to the number 5 and trying to delete it at the same time
upcoming_releases = 2
total = current_count + upcoming_releases



#CORRECT SOLUTION
current_count = 14
planned = 5     #planned variable exists
upcoming_releases = 2

del planned    #we delete that planned variable
total = current_count + upcoming_releases

What you did was the first block of code above. The correct code is the one below it. You are not supposed to modify the given variables. Take a look at the comments I put in the above code. Tell me if you understand and if it works now

Kevin Faust
Kevin Faust
15,353 Points

Challenge 1: easily delete planned

del planned

Challenge 2: add up the two things that the instructions said to add and assign to variable called "total"

total = current_count + upcoming_releases

I did as you did in the second challenge but it is still wrong !

Kevin Faust
Kevin Faust
15,353 Points

I tried it and it works perfectly fine. maybe try switching browsers?

invalid syntax (delete.py, line 2) when i solved the 2 challenge , i see this phrase invalid syntax (delete.py, line 2)

Kevin Faust
Kevin Faust
15,353 Points

can you post your code that you have?

how could you cut and post ?

Kevin Faust
Kevin Faust
15,353 Points

select all your code, press ctrl + c, then do ctrl + v here

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

total = current_count + upcoming_releases

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

even wrong

Kevin Faust
Kevin Faust
15,353 Points

Where is your planned variable?? That is not what i wrote. Please read what i wrote above.

perfect , was this challenge is difficult or i am dumb :)

Perfect , was this challenge difficult or i am dumb :)

Kevin Faust
Kevin Faust
15,353 Points

Lol this challenge was not too difficult but its ok if you have troubles. Learning is never easy