1. Python / Говнокод #13828

    −111

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    #!/usr/bin/python
    
    lst = [1,2,2,3,4,4,5,6,5,6]
    lst_new = []
    
    for (counter, i) in enumerate(lst):
        if counter != len(lst) - 1:
            if lst[counter] == lst[counter+1]:
                continue
        if counter != 0:
            if lst[counter] == lst[counter-1]:
                continue
        lst_new.append(i)
    
    print lst
    print lst_new

    Запостил: vickers, 20 Сентября 2013

    Комментарии (4) RSS

    Добавить комментарий