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?
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?
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'))
You have assigned (or are assigning somewhere else in your code, since it is not clear from your posted code where exactly you are doing the assignment) the function to a variable. This is something like function pointers of c.
Given your posted code, you are probably writing somewhere:
variable = hand_player
and you are effectively storing the "entire function" to a variable. Of course, this is not exactly what is happening, only the pointer to the address in memory, where the code of the function is located, is stored to your variable.
Technically, thereafter, you can call your function through your stored variable in the same way, i.e.
variable(some_card)
See this question for a bit more information.
As techytushar is suggesting, you were probably trying to call the function instead, right? In that case, you need to pass the arguments to it.