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 trialDarren Taylor
1,052 PointsHi, I'm trying to delete a variable below that say's "planned = 5", please help, thanks.
Hi, I'm trying to delete a variable below that say's "planned = 5", please help, thanks.
current_count = 14
planned = 5
upcoming_releases = 2
del variable_planned = 5
1 Answer
Ezra Siton
12,644 PointsFirst, in general you try to delete var (del variable_planned), but you don't declare this var - this will throw
"SyntaxError: invalid syntax ".
Test this code: https://repl.it/languages/python3
Second, This is also syntax error (you can not declare var and also del this var like this)
del planned = 5
Third, you need to delete planned var (follow the instructions)
current_count = 14
planned = 5
upcoming_releases = 2
del planned
Darren Taylor
1,052 PointsDarren Taylor
1,052 PointsThank you very much for your assistance Ezra, your help has been excellent!
jose m arredondo quintero
Courses Plus Student 198 Pointsjose m arredondo quintero
Courses Plus Student 198 Pointsthanks