14/15 PLZ HELP. print ur code so i can compare


def remove_duplicates(seq):
for i in seq:
for k in new:
if i not in new:
return new
print remove_duplicates(m)


Please first....
Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.


@coderockstar00502 try to follow the editing guide that @leonhard_wettengmx_n has posted regarding code formatting. it makes it easier for people to help with the problem. This also allows for a quick response
But anyways here is your code corrected

def remove_duplicates(seq):
    for i in seq:
        for k in new:
            if i not in new:
    return new
print (remove_duplicates(m))


Here was my original attempt

def remove_duplicates (items):
    newList = []
    value = []
    for i in items:
        if i in value:
    for i in value:

It works but it seems needlessly long for the task....

really liked your short code but you could write it like this
with less lines :smile:


def remove_duplicates(seq):
    newList = []
    for i in seq:
        if not in newList:


@marmaa the code i posted was @coderockstar00502 's code he originally posted corrected. but how you implemented it is corrected.


in his code did nothing for the solution. all he did was create a list with an empty string.
Which is why he ended up using this line


to take away that empty string in the list. But it was unnecessary.You got the answer right


Ah I completely misread that !!!!! Thanks any-ways


def remove_duplicates(listings):
    newList = []
    for i in range(len(listings)):
       if listings[i] not in newList:
    return newList


I'm fairly new to programming in general so I'm often wondering whether there are coding best practices that I'm missing out on as I go forward as most of my scripts are shorter and less complex than what I see others post in these forums. For example, on this remove_duplicates function, I wound up using:

def remove_duplicates(items):
    new_lst = []
    for n in items:
        if n not in new_lst:
    return new_lst

Which to me is simple, concise, and easily readable. Other functions I've been writing throughout these practices have been done in a similar manner. However, when I often look on here to see what others are doing, the code is more complicated than mine. So I'm left wondering if I'm getting into bad habits early on and perhaps I should be taking a different approach to how I logically build these functions.

I realize my comment is more general than this specific exercise, but this happens to be the one I was working on when I compared our codes.


as help to indentation
= http://discuss.codecademy.com/t/14-15-plz-help-print-ur-code-so-i-can-compare/10110/2?u=leonhard_wettengmx_n


Thanks, Leonhard. I had read your post and did what you said to do but I thought I was also remembering something about using three `s in front of each line or some such. Doing both obviously didn't work, but taking out the symbols and only using your instructions did the trick.