Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my function returning "function ___ at 0x7f37c058d378"?

Tags:

python

This function:

hand_p = ''

def hand_player(card_variable):
    global hand_p
    hand_p = hand_p + str(card_variable)
    return hand_p

is returning something like function hand_player at 0x7f37c058d378.

Why is this happening?

like image 617
Sondr Avatar asked Nov 25 '25 13:11

Sondr


1 Answers

You haven't called the function anywhere in your code. If you wanted to pass an argument of 'a' you could call it as follows:

hand_p = ''

def hand_player(card_variable):
    global hand_p
    hand_p = hand_p + str(card_variable)
    return hand_p

print(hand_player('a'))

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!