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

Ryan Shah
PLUS
Ryan Shah
Courses Plus Student 239 Points

How can i solve this problem

i tried sum function and also make a new variable the code is running on python shell but not working here..Is there any other solution for this please let me know.. Thank you

delete.py
current_count = 14
planned = 4
upcoming_releases = 2
del planned

total = 16

1 Answer

andren
andren
28,558 Points

There are two issues with your code:

  1. You have changed the value assigned to the planned array. When the challenge loads it starts out at 5 and you have changed it to 4. Making any changes in these challenges that are not explicitly asked for will often break the code validation and lead you to be unable to complete the challenge.

  2. You are not meant to calculate the sum of current_count and upcoming_releases yourself. You are meant to have Python do that for you automatically by using the + operator and then assigning the result of that to the total variable.

Like this:

current_count = 14
planned = 5
upcoming_releases = 2
del planned

total = current_count + upcoming_releases
Ryan Shah
Ryan Shah
Courses Plus Student 239 Points

Oh.. I really missed that.. Thank you so much next time i read the code carefully