简体   繁体   中英

Why am I getting presentation error in python list?

My code is following:

d = [int(d) for d in input().split()]

l = []
c = 1
for i in range(len(d)):
    if d[i] not in l:
        l.append(d[i])
        c += 1

for i in range(len(l)):
    print(l[i], end=" ")

Evaluation:

Input : 1 1 9 5 2 1 4 1 1 4 0 6 1 4 3 3 2 2 0 Output : 1 9 5 2 4 0 6 3
Status : Passed after ignoring Presentation Error

PresentationError is a mixing between some tabs and spaces. You can delete all "tabs" in your script and rewrite them consistently or run python -tt yourscript.py so you find the error.

As far as I know, you can copy paste your code from your question again because it worked perfectly for me after copying it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM