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 for Beginners Correct errors

do we edit the code that is already written or type it out in our own workspace?

when i attempt to add changes to the code, it doesn't allow me to make any.

errors.py
print("Hello")
print(name)

print("Let's do some math!")
print(5 + "a")

print("Thanks for playing along!')

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,454 Points

You should be able to place the cursor into the black background buffer and edit the existing code.

Try reloading the page. Maybe it didn't load completely.

thanx buddy! you were right..it was just buggy lol. One more quick question for ya if not too much to ask! Still on python but a bit further.. I am supposed to add two variables together to equal a "total" then print the total

EX:

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

# (the bottom line is how i thought it would be done, followed by):

print(total)

but it states it is wrong..i have been trying to figure this out for 20min, could you possibly point me in the direction of what i am doing wrong here please?

[MOD: added ``` python markdown formatting -cf]

Chris Freeman
Chris Freeman
Treehouse Moderator 68,454 Points

Your current line is appending two strings:

$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> total = "current_count"+"upcoming_releases"
>>> total
'current_countupcoming_releases'

You need to remove the quotation marks to reference the variable names:

>>> current_count = 14
>>> upcoming_releases = 2
>>> total = current_count + upcoming_releases
>>> total
16