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

  • bethliebert

    bethliebert

    23 EKİM 2008
  • Gali B

    Gali B

    1 EYLÜL 2006
  • SalGames2016

    SalGames2016

    17 Kasım 2012