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

  • andyabc45

    andyabc45

    1 Mayıs 2011
  • Majestic Casual

    Majestic Cas

    28 NİSAN 2012
  • bored before i even began

    bored before

    30 Mart 2009