<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.>
<In what way does your code behave incorrectly? Include ALL error messages.>
<What do you expect to happen instead?>```python
Replace this line with your code.
def remove_duplicates(inputlist): if inputlist == : return  inputlist = sorted(inputlist) outputlist = [inputlist] for i in inputlist: if i > outputlist[-1]: outputlist.append(i) return outputlist print remove_duplicates([4,6,2,6,87,34])
what I do not understand here is if i > outputlist[-1]: part. From the piece of code outputlist = [inputlist] we can see that outputlist is fixed - it has a value of first number in inputlist. That number doesn’t change so for ex. when we have two dupes after the first number in the inputlist it will not recognize it.
For example, if the sorted inputlist is [ 2,4,6,6,8,10] outputlist will give 2 all the time which means that duplicates will not be removed. What I mean is that outputlist[-1] always refers to the same value.
What is wrong here in my logic? I assume that given solution is correct.