Bug in "15. Practice Makes Perfect"


I dunno what I'd did but it's pass through assertions.

str = "Print hack bed"
print list(list.index('hack'))


They're asking you to define a censor(text, word) function :confused:


@root4af is correct. You need to create a censor function.

However, it is also interesting that your code passed, when it should have been rejected. You found a bug in Codecademy's submission correctness test (SCT) for this exercise.

This statement led to a crash of the SCT ...

str = "Print hack bed"


Well, look at that.~


Yeah, thanks, I'm already passed it.


The SCTs for the Python exercises are written in Python.

Here, we have a list of the built-in functions for Python 2: 2. Built-in Functions.

One of those functions is class str(object='').

When the SCT tried to use this function, it was not longer operative, because this statement replaced the function with a string ...

str = "Print hack bed"

There are three issues to acknowledge from this observation.

  • Thanks for your input, @root4af.
  • @ya_sam, it is cool that you found this bug.
  • It is best not to use the name of a built-in function as the name of a variable.


i thought ya_sam found the bug?


Totally not me though! lol


Oops, try again! (said to myself).


yes, you passed it. But you didn't really program. If you are satisfied with this, you can move on, or you can actually build a program which will censor words in a string (if you didn't already)


Yes, @ya_sam , you should follow @stetim94 's suggestion. Then you can get twice as much benefit from this exercise as other users do.

You will have learned ...

  • How to crash the SCT.
  • How to write the censor function.



I'd already did it. This post was just for bug report.


@ya_sam, thanks for the bug report; this bug might not get fixed, however, because Codecademy is currently developing an entirely new Python track.

See Important Changes to Codecademy Courses.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.