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

What moron thought lets crush the new guy w code and say "debug" I barely know how to code...? WTF!!!!! small steps!

OMFG, small steps, you comp sci guys know code... ok we get it you are freaking smart. Well smart guy you are forgetting how much you know and talk above my head, this exercise has me clueless but your standing there expecting me to be able to decode your code?

pull you head out and use smaller steps.

NO I DONT KNOW HOW TO CODE. I Barely know what code is let alone how to spot errors.

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

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

print("Thanks for playing along!')

4 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Before you type anything in the code, you should run "Check work". This will bring up an error that you're suppoed to fix. And the first error is "EOL while scanning string literal". This indicates that we have a string literal that is not properly closed. Take a look at the last print statement. Do the quotations match? No. So fix those.

And when you run "Check work" again, you'll get a new error. This one is: "Bummer! NameError: name 'name' is not defined". And they're correct. On the second line you're trying to print out the value of name. But you haven't said anywhere what name is equal to. Try doing name = "Andrew" somewhere before that print statement.

When you fix that, you'll run "Check work" again and get a new error. This one says " Bummer! TypeError: unsupported operand type(s) for +: 'int' and 'str'". And they're correct. You have this line in your code: print(5 + "a") We cannot add strings and numbers together in this manner. So you can change the "a" to a number.

When you fix these, the challenge will pass.

I feel obligated to tell you that when you post to the Community, you are addressing fellow students. We're students just like you! So please refrain from screaming at us. If you want to contact Treehouse directly you can choose one of the support options by clicking on the question mark icon on the left side of this page :arrow_left:. I hope this helps! :sparkles:

Steven Parker
Steven Parker
231,236 Points

Learning how to spot errors is part of learning how to code. These are the "small steps".

The errors in this sample are pretty basic:

  • A variable that needs to be assigned before it is used
  • A number being combined with a string (the number can be replaced with a string)
  • A string that has mismatched quote characters at the beginning and end

Now that you know what to look for perhaps it won't seem so daunting.

Thanks guys, some of these questions feel like 1 step, then 2 steps, then 3 then 8 steps and I'm lost.

Others are small steps and I can learn the material as well as go right through the challenge.

I appreciate your help and will refrain from screaming. Sorry.

Thanks Jennifer,

Coding like anything else in the world has to be taught to people in the way people learn.

What I like about teamtreehouse so far is that you guys are available and you are chunking down the concepts.

Too many people who claim to teach code are lazy and have huge egos, so they tell people this is how i learned so this is how you learn.

They forgot or were never taught that some people are visuals, kinesthetics or