Question: the idea is within class Card
I have dict

```
pack_of_cards = {'2': 2,'3': 3,'4': 4,'5': 5,'6': 6, \
                 '7': 7,'8': 7,'9': 9,'10': 10,'J': 10, \
                 'D': 10,'K': 10,'T': 10}

```

I need this class to return a random set of key and value as a dict.

For example:

```
Card() == {'T': 10}

```

Thanks to everyone.

Answer: 
You can do this using a method in the `random` module, but it wouldn't make sense unless your `Card` class implements an `__eq__` method. Example:

```
In [450]: class Card:
     ...:     def __init__(self, suite, num):
     ...:         self.suite = suite
     ...:         self.num = num
     ...:
     ...:     def __eq__(self, item):
     ...:         k, v = list(item.items())[0]
     ...:         return True if (self.suite == k and self.num == v) else False
     ...:     

In [452]: c = Card('T', 10)

In [454]: c == {'T' : 10}
Out[454]: True 

```

Now that you have a working class, you can use `random.choice` to extract a card:

```
In [470]: x = random.choice(list(pack_of_cards.items()))

In [471]: dict([x])
Out[471]: {'D': 10}

```
You can use `random.sample()` to return the number of cards you need, e.g.:

```
>>> import random
>>> dict(random.sample(pack_of_cards.items(), k=5))
{'10': 10, '5': 5, '9': 9, 'J': 10, 'K': 10}

```

*(not a bad hand for cribbage)*