# Arup Guha
# 2/1/2012
# Simulates buying packs of baseball cards until a whole set of
# cards is acquired.

import random

def main():

    # Initialize variables.
    random.seed()
    cards = set()
    numpacks = 0
    costPerPack = 1.49

    # Keep on buying packs until we get all the cards.
    while len(cards) < 792:

        # Generate one pack of cards.
        for i in range(15):
            cards.add(random.randint(1,792))

        # Update the number of packs we bought.
        numpacks = numpacks + 1

    # Print out how many packs we had to but to get the complete set.
    print("You collected the set by buying",numpacks,"packs.")
    print("You spent",numpacks*costPerPack,"dollars.")
    
main()

        
