SORU
23 Mart 2012, Cuma


Bul ve liste Python listesinde çoğaltır

Nasıl bir Python listesi çiftleri bulmak ve çiftleri bir liste oluşturmak? Liste sadece tamsayılar.

CEVAP
1 Mart 2013, Cuma


>>> l = [1,2,3,4,4,5,5,6,1]
>>> set([x for x in l if l.count(x) > 1])
set([1, 4, 5])

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • ASUS North America

    ASUS North A

    12 AĞUSTOS 2008
  • FUzzyBUnnyBOoties

    FUzzyBUnnyBO

    3 EKİM 2007
  • xCraash

    xCraash

    6 Temmuz 2012