R
R
Roman Komyagin2020-08-19 23:57:15
Python
Roman Komyagin, 2020-08-19 23:57:15

Why does print output function at 0x instead of a value?

Here is the code:

def win():
  for x in r['lifeTimeStats']:
    if x.get('key') == 'Wins':
      return x.get('value')
      break

def kill():
  for c in r['lifeTimeStats']:
    if c.get('key') == 'Kills':
      return c.get('value')			
      break

def winrate():
  for v in r['lifeTimeStats']:
    if v.get('key') == 'Win%':
      return v.get('value')
      break

def kd():
  for b in r['lifeTimeStats']:
    if b.get('key') == 'K/d':
      return b.get('value')
      break

qwerty = input('Нажмите ENTER, чтобы начать.')
while qwerty != 'Назад':
  ni = input('Ник игрока: ')
  pl = input('Платформа: ')

  response = requests.get(
  		'https://api.fortnitetracker.com/v1/profile/' + pl + '/' + ni,
  		headers= {'TRN-Api-Key':TRN}
  		)
  r = response.json()

  print('\nВот статистика ' + ni)
  print('\nПобеды - ', win, '\nУбийства - ', kill, '\nПроцент побед', winrate, '\nK/D - ', kd)

  qwerty = input('Чтобы выйти, введи "Назад".\n')


Output:
Wins - function win at 0x0180BB68
Kills - function kill at 0x03C2A070 Win
Percentage function winrate at 0x03C2A028
K/D - function kd at 0x03C2A148 Type
"Back" to exit.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-08-20
@BloomEe

Because win is a function, and win() is the result of calling that function.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question