[Python] working with HUGE lists in python

Discussão em 'Python' iniciado por Stack, Janeiro 17, 2025.

  1. Stack

    Stack Membro Participativo

    how can I manage a huge list of 100+ million strings? How can i begin to work with such a huge list?

    example large list:

    cards = [
    "2s","3s","4s","5s","6s","7s","8s","9s","10s","Js","Qs","Ks","As"
    "2h","3h","4h","5h","6h","7h","8h","9h","10h","Jh","Qh","Kh","Ah"
    "2d","3d","4d","5d","6d","7d","8d","9d","10d","Jd","Qd","Kd","Ad"
    "2c","3c","4c","5c","6c","7c","8c","9c","10c","Jc","Qc","Kc","Ac"
    ]

    from itertools import combinations

    cardsInHand = 7
    hands = list(combinations(cards, cardsInHand))

    print str(len(hands)) + " hand combinations in texas holdem poker"

    Continue reading...

Compartilhe esta Página