Duplicate ... practice makes perfect


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>https://www.codecademy.com/courses/learn-python/lessons/practice-makes-perfect/exercises/removeduplicates?

<In what way does your code behave incorrectly? Include ALL error messages.>your code changed the original list

<What do you expect to happen instead?>the correct answer

```python

def rem(dup):
ndp=dup
ndp.sort()
for i in range(len(ndp) - 2):
if (ndp[i] == ndp[i + 1]):
del ndp[i + 1]
print dup
print ndp
return ndp
j = [3, 35, 56, 55, 55]
rem(j)

<do not remove the three backticks above>

#2

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