python(2.7) function takes the multiple integers and a list, and return an integer and a list

63 views Asked by At

If you see the players.py file code below, three integers and one list are used as input arguments of the first_player(). And I want return of the function to be a list and an integer(I need only one for return). However I only get an empty list. How can I recall a list and an integer in this case?


def dealing():

    player1 = list()
    start_drawing = 0
    nc = 0
    cards = L_shuffle_deck.shuffle_deck()
    n = len(cards) - 1 # n = 51    
    while start_drawing < 2:
        players.first_player(player1, n, nc, cards)
        start_drawing += 1
        nc += 1

    print player1

    ...

players.py below..

def first_player(player1, n, nc, cards):

    player1 = player1 + [cards[n]]                   
    card_order = player1                             
    changing = conv_cards.assigning(nc, card_order)  
    player1[nc] = changing[nc]                       
    cards = cards[:n]                                
    n -= 1                                           

    return player1, n #doesn't work
    #I want my output to be player1(list), n(integer)
1

There are 1 answers

1
AudioBubble On BEST ANSWER

From a cursory look at your code, it appears you return values from your function, but you don't assign those values to any variable(s).

Try this in your dealing function:

...
player1, n = players.first_player(player1, n, nc, cards)
...