[Tutor] What is wrong with my code?

Danny Yoo dyoo at hashcollision.org
Mon Mar 30 03:27:22 CEST 2015


On Fri, Jan 23, 2015 at 1:40 PM, Antonia van der Leeuw
<antonia.van.der.leeuw at hotmail.nl> wrote:
> Hehey!
>
> I'm learning python on a website called codecademy.com, where I made a
> program to decode binary numbers. I guess the site uses a different
> compiler, because on the site my code worked fine, but when I copied and
> pasted it into the Python IDLE (3.4.2) it didn't work! I'm really don't know
> what is wrong with my code, can anyone of you fine sirs help me?


Hi Antonia,

Python 3 is a different language than Python 2.  It looks like the
codeacademy materials use Python 2, so you should probably do the same
on your local system.

By the way, next time you ask a question where something goes wrong,
also show us what went wrong.  Be descriptive!  When you learn to
program, you'll find that programs break for all sorts of crazy
pedantic reasons.  Normally, a Python program will explain *why* it
broke.  In your specific situation, it should have said something that
points to one of the lines of your program, with a particular error
message.  When you see this and ask for help, copy and paste the error
message.  It will help.


Good luck to you!


More information about the Tutor mailing list