How can i deal a hand in python
Question: im trying to deal a hand in python with random.shuffle and its keeps giving me
an error, can some one help me figure out whats wrong with it.

    
    
    # [import statements]
    import q1fun
    # [constants]
    
    # [rest of program code]
    number = input("howmany cards to you want dealt?")
    a = q1fun.deal(number)
    print (a)
    
    # [import statements]
    import random
    # [constants]
    
    def deal(x):
    
    
        y = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
        a = random.shuffle(y(x))
    
    
        return(a)
    

howmany cards to you want dealt?5 Traceback (most recent call last): File
"C:\Users\Eddie\workspace\cp104\durb8250_a16\src\q1.py", line 18, in a =
q1fun.deal(number) File
"C:\Users\Eddie\workspace\cp104\durb8250_a16\src\q1fun.py", line 29, in deal a
= random.shuffle(y(x)) TypeError: 'list' object is not callable


Answer: `random.shuffle(y)` shuffles the list `y` inplace and returns `None`. So

    
    
    def deal(n):
        "Return a hand of n cards"
        y = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9,
             10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6,
             7, 8, 9, 10, 11, 12, 13]
        random.shuffle(y)
        return y[:n]
    

might be closer to what you want.

Or omit `random.shuffle(y)` and just use `random.sample`:

    
    
    return random.sample(y, n)
    

